mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-20 23:45:23 +02:00
Bug 513345 - A lot of time during indexing is spent inside
CompositeValue.create Minor code cleanup. Change-Id: I92ea01711034df5fa88cd41a81a54450fdb0ba6c
This commit is contained in:
parent
5b22093f47
commit
1735a17c5e
1 changed files with 4 additions and 3 deletions
|
@ -376,7 +376,9 @@ public abstract class PDOMWriter implements IPDOMASTProcessor {
|
||||||
try {
|
try {
|
||||||
final IBinding binding = name.resolveBinding();
|
final IBinding binding = name.resolveBinding();
|
||||||
if (binding instanceof ICPPInternalDeclaredVariable) {
|
if (binding instanceof ICPPInternalDeclaredVariable) {
|
||||||
variables.add((ICPPInternalDeclaredVariable) binding);
|
ICPPInternalDeclaredVariable variable = (ICPPInternalDeclaredVariable) binding;
|
||||||
|
if (variables.add(variable))
|
||||||
|
variable.allDeclarationsDefinitionsAdded();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.getPropertyInParent() == ICPPASTTemplateId.TEMPLATE_NAME &&
|
if (name.getPropertyInParent() == ICPPASTTemplateId.TEMPLATE_NAME &&
|
||||||
|
@ -424,7 +426,6 @@ public abstract class PDOMWriter implements IPDOMASTProcessor {
|
||||||
// Precalculate types and initial values of all indexed variables to avoid doing it later when writing
|
// Precalculate types and initial values of all indexed variables to avoid doing it later when writing
|
||||||
// to the index.
|
// to the index.
|
||||||
for (ICPPInternalDeclaredVariable variable : variables) {
|
for (ICPPInternalDeclaredVariable variable : variables) {
|
||||||
variable.allDeclarationsDefinitionsAdded();
|
|
||||||
if (isVariableIndexed(variable)) {
|
if (isVariableIndexed(variable)) {
|
||||||
// Type and initial value will be cached by the variable.
|
// Type and initial value will be cached by the variable.
|
||||||
variable.getType();
|
variable.getType();
|
||||||
|
@ -439,7 +440,7 @@ public abstract class PDOMWriter implements IPDOMASTProcessor {
|
||||||
if (variable instanceof ICPPField)
|
if (variable instanceof ICPPField)
|
||||||
return true;
|
return true;
|
||||||
IBinding owner = variable.getOwner();
|
IBinding owner = variable.getOwner();
|
||||||
if (owner == null || owner instanceof IASTTranslationUnit || owner instanceof ICPPNamespace)
|
if (owner == null || owner instanceof ICPPNamespace)
|
||||||
return true;
|
return true;
|
||||||
return owner instanceof ICPPFunction && ((ICPPFunction) owner).isConstexpr();
|
return owner instanceof ICPPFunction && ((ICPPFunction) owner).isConstexpr();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue