diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-14 22:23:11 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-14 22:23:11 +0000 |
commit | 7e747957cdfd49b7f6d3f1cce7f373f093f52e11 (patch) | |
tree | 3c20d05ec95d218c79451ed3bff85d383534518d /clang/tools/libclang/Indexing.cpp | |
parent | 33e5adea869ba85199c1236421b7181158cfe4e8 (diff) | |
download | bcm5719-llvm-7e747957cdfd49b7f6d3f1cce7f373f093f52e11.tar.gz bcm5719-llvm-7e747957cdfd49b7f6d3f1cce7f373f093f52e11.zip |
[libclang] Indexing: only index implicit template instantiations via an opt-in indexing option.
llvm-svn: 150517
Diffstat (limited to 'clang/tools/libclang/Indexing.cpp')
-rw-r--r-- | clang/tools/libclang/Indexing.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index 0d6da2824da..d1af38887b7 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/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; } }; |