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 | 58d2dbea680a75de266c5eff77cc15c323cfd48a (patch) | |
tree | 4bcc4b7b52b15b1c7add0c8d1283382e3e644ac3 /tools/libclang/IndexTypeSourceInfo.cpp | |
parent | 625bb569df0c34feec0d52c0ec5215f21ef2e054 (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/IndexTypeSourceInfo.cpp')
-rw-r--r-- | tools/libclang/IndexTypeSourceInfo.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/libclang/IndexTypeSourceInfo.cpp b/tools/libclang/IndexTypeSourceInfo.cpp index 1e75378105..34acffcf7a 100644 --- a/tools/libclang/IndexTypeSourceInfo.cpp +++ b/tools/libclang/IndexTypeSourceInfo.cpp @@ -73,9 +73,15 @@ public: bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc TL) { if (const TemplateSpecializationType *T = TL.getTypePtr()) { - if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) - IndexCtx.handleReference(RD, TL.getTemplateNameLoc(), - Parent, ParentDC); + if (IndexCtx.shouldIndexImplicitTemplateInsts()) { + if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) + IndexCtx.handleReference(RD, TL.getTemplateNameLoc(), + Parent, ParentDC); + } else { + if (const TemplateDecl *D = T->getTemplateName().getAsTemplateDecl()) + IndexCtx.handleReference(D, TL.getTemplateNameLoc(), + Parent, ParentDC); + } } return true; } |