mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +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 {
|
||||
final IBinding binding = name.resolveBinding();
|
||||
if (binding instanceof ICPPInternalDeclaredVariable) {
|
||||
variables.add((ICPPInternalDeclaredVariable) binding);
|
||||
ICPPInternalDeclaredVariable variable = (ICPPInternalDeclaredVariable) binding;
|
||||
if (variables.add(variable))
|
||||
variable.allDeclarationsDefinitionsAdded();
|
||||
}
|
||||
|
||||
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
|
||||
// to the index.
|
||||
for (ICPPInternalDeclaredVariable variable : variables) {
|
||||
variable.allDeclarationsDefinitionsAdded();
|
||||
if (isVariableIndexed(variable)) {
|
||||
// Type and initial value will be cached by the variable.
|
||||
variable.getType();
|
||||
|
@ -439,7 +440,7 @@ public abstract class PDOMWriter implements IPDOMASTProcessor {
|
|||
if (variable instanceof ICPPField)
|
||||
return true;
|
||||
IBinding owner = variable.getOwner();
|
||||
if (owner == null || owner instanceof IASTTranslationUnit || owner instanceof ICPPNamespace)
|
||||
if (owner == null || owner instanceof ICPPNamespace)
|
||||
return true;
|
||||
return owner instanceof ICPPFunction && ((ICPPFunction) owner).isConstexpr();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue