diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-08 03:04:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-08 03:04:33 +0000 |
commit | 7b318d16992cb68567c3ee217b86cac2ed11d5d8 (patch) | |
tree | 9697d5c4daa42034ead05bc9e9241d1b3cab1953 /tools | |
parent | 9caf440928c16a8862de932fd19744dc8a6f4157 (diff) |
[libclang] Indexing: When suppressing references, suppress references
of bases in C++ classes. rdar://10768707
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/IndexingContext.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp index 2e69c46849..059d842515 100644 --- a/tools/libclang/IndexingContext.cpp +++ b/tools/libclang/IndexingContext.cpp @@ -646,6 +646,19 @@ bool IndexingContext::handleCXXRecordDecl(const CXXRecordDecl *RD, CXXDInfo.CXXClassInfo.bases = BaseList.getBases(); CXXDInfo.CXXClassInfo.numBases = BaseList.getNumBases(); + if (suppressRefs()) { + // Go through bases and mark them as referenced. + for (unsigned i = 0, e = BaseList.getNumBases(); i != e; ++i) { + const CXIdxBaseClassInfo *baseInfo = BaseList.getBases()[i]; + if (baseInfo->base) { + const NamedDecl *BaseD = BaseList.BaseEntities[i].Dcl; + SourceLocation + Loc = SourceLocation::getFromRawEncoding(baseInfo->loc.int_data); + markEntityOccurrenceInFile(BaseD, Loc); + } + } + } + return handleDecl(OrigD, OrigD->getLocation(), getCursor(OrigD), CXXDInfo); } |