Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-02-14 09:36:15 +0000
committerMarkus Schorn2008-02-14 09:36:15 +0000
commit190c47275764b14ea3cfff3abbb45530e1502f63 (patch)
treeaddd3db109042bcc34147ebd25351a45dfb8e74e /core/org.eclipse.cdt.core/parser
parent2e0d07d89bf416d3b39c7b292e2d92d46bc66e47 (diff)
downloadorg.eclipse.cdt-190c47275764b14ea3cfff3abbb45530e1502f63.tar.gz
org.eclipse.cdt-190c47275764b14ea3cfff3abbb45530e1502f63.tar.xz
org.eclipse.cdt-190c47275764b14ea3cfff3abbb45530e1502f63.zip
Using directives for fast indexer with cross references disabled, related to 200673+216527.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java10
2 files changed, 15 insertions, 10 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
index 8e85760d16d..715c99c731b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
@@ -33,6 +33,7 @@ import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.ITypedef;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDirective;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
@@ -212,7 +213,7 @@ abstract public class PDOMWriter {
reportProblem((IProblemBinding) binding);
else if (name.isReference()) {
if (fSkipReferences == SKIP_TYPE_REFERENCES) {
- if (isTypeReferenceBinding(binding) && !isInheritanceSpec(name)) {
+ if (isTypeReferenceBinding(binding) && !isRequiredReference(name)) {
na[0]= null;
fStatistics.fReferenceCount--;
}
@@ -284,10 +285,11 @@ abstract public class PDOMWriter {
// names
ast.accept(new IndexerASTVisitor() {
+ @Override
public void visit(IASTName name, IASTName caller) {
if (fSkipReferences == SKIP_ALL_REFERENCES) {
if (name.isReference()) {
- if (!isInheritanceSpec(name)) {
+ if (!isRequiredReference(name)) {
return;
}
}
@@ -306,7 +308,7 @@ abstract public class PDOMWriter {
});
}
- protected boolean isInheritanceSpec(IASTName name) {
+ protected final boolean isRequiredReference(IASTName name) {
IASTNode parentNode= name.getParent();
if (parentNode instanceof ICPPASTBaseSpecifier) {
return true;
@@ -315,6 +317,9 @@ abstract public class PDOMWriter {
IASTDeclSpecifier ds= (IASTDeclSpecifier) parentNode;
return ds.getStorageClass() == IASTDeclSpecifier.sc_typedef;
}
+ else if (parentNode instanceof ICPPASTUsingDirective) {
+ return true;
+ }
return false;
}
@@ -422,7 +427,7 @@ abstract public class PDOMWriter {
* Makes a copy of the current progress information and returns it.
* @since 4.0
*/
- protected IndexerProgress getProgressInformation() {
+ public IndexerProgress getProgressInformation() {
synchronized (fInfo) {
return new IndexerProgress(fInfo);
}
@@ -432,7 +437,7 @@ abstract public class PDOMWriter {
* Updates current progress information with the provided delta.
* @since 4.0
*/
- protected void updateInfo(int completedSources, int completedHeaders, int totalEstimate) {
+ protected final void updateInfo(int completedSources, int completedHeaders, int totalEstimate) {
synchronized(fInfo) {
fInfo.fCompletedHeaders+= completedHeaders;
fInfo.fCompletedSources+= completedSources;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java
index 0a3b70763ab..4657737690d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java
@@ -91,11 +91,6 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD
traceEnd(start, fIndex);
}
-
- public IndexerProgress getProgressInformation() {
- return super.getProgressInformation();
- }
-
/**
* Checks whether a given debug option is enabled. See {@link IPDOMIndexerTask}
* for valid values.
@@ -116,6 +111,7 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD
}
+ @Override
protected String getASTPathForParsingUpFront() {
final IProject project = getProject().getProject();
final IPath prjLocation= project.getLocation();
@@ -125,6 +121,7 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD
return prjLocation.append(super.getASTPathForParsingUpFront()).toString();
}
+ @Override
protected AbstractLanguage[] getLanguages(String filename) {
IContentType ct= CCorePlugin.getContentType(filename);
if (ct != null) {
@@ -142,6 +139,7 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD
return new AbstractLanguage[0];
}
+ @Override
protected IScannerInfo createDefaultScannerConfig(int linkageID) {
IProject project= getProject().getProject();
IScannerInfoProvider provider= CCorePlugin.getDefault().getScannerInfoProvider(project);
@@ -159,6 +157,7 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD
return getIndexer().getProject();
}
+ @Override
protected final IWritableIndex createIndex() {
try {
return ((IWritableIndexManager) CCorePlugin.getIndexManager()).getWritableIndex(getProject());
@@ -168,6 +167,7 @@ public abstract class PDOMIndexerTask extends AbstractIndexerTask implements IPD
return null;
}
+ @Override
protected final ITodoTaskUpdater createTodoTaskUpdater() {
return new TodoTaskUpdater();
}

Back to the top