aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/Indexing.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-14 22:23:11 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-14 22:23:11 +0000
commit58d2dbea680a75de266c5eff77cc15c323cfd48a (patch)
tree4bcc4b7b52b15b1c7add0c8d1283382e3e644ac3 /tools/libclang/Indexing.cpp
parent625bb569df0c34feec0d52c0ec5215f21ef2e054 (diff)
[libclang] Indexing: only index implicit template instantiations via an opt-in indexing option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/Indexing.cpp')
-rw-r--r--tools/libclang/Indexing.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp
index 0d6da2824d..d1af38887b 100644
--- a/tools/libclang/Indexing.cpp
+++ b/tools/libclang/Indexing.cpp
@@ -137,11 +137,17 @@ public:
virtual void HandleInterestingDecl(DeclGroupRef D) {}
virtual void HandleTagDeclDefinition(TagDecl *D) {
+ if (!IndexCtx.shouldIndexImplicitTemplateInsts())
+ return;
+
if (IndexCtx.isTemplateImplicitInstantiation(D))
IndexCtx.indexDecl(D);
}
virtual void HandleCXXImplicitFunctionInstantiation(FunctionDecl *D) {
+ if (!IndexCtx.shouldIndexImplicitTemplateInsts())
+ return;
+
IndexCtx.indexDecl(D);
}
};
@@ -194,7 +200,12 @@ public:
indexDiagnostics(CXTU, IndexCtx);
}
- virtual TranslationUnitKind getTranslationUnitKind() { return TU_Complete; }
+ virtual TranslationUnitKind getTranslationUnitKind() {
+ if (IndexCtx.shouldIndexImplicitTemplateInsts())
+ return TU_Complete;
+ else
+ return TU_Prefix;
+ }
virtual bool hasCodeCompletionSupport() const { return false; }
};