From 95c0feb5e0aa8cefa660bb74bebcecfd2b6045e5 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 8 Feb 2012 03:04:33 +0000 Subject: [PATCH] [libclang] Indexing: When suppressing references, suppress references of bases in C++ classes. rdar://10768707 llvm-svn: 150048 --- clang/tools/libclang/IndexingContext.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 2e69c4684948..059d84251598 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/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); }