mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Using directives for fast indexer with cross references disabled, related to 200673+216527.
This commit is contained in:
parent
2e0d07d89b
commit
190c472757
2 changed files with 15 additions and 10 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue