[libclang] Indexing: When suppressing references, suppress references

of bases in C++ classes. rdar://10768707

llvm-svn: 150048
This commit is contained in:
Argyrios Kyrtzidis 2012-02-08 03:04:33 +00:00
parent 0ee8c513f7
commit 95c0feb5e0
1 changed files with 13 additions and 0 deletions

View File

@ -646,6 +646,19 @@ bool IndexingContext::handleCXXRecordDecl(const CXXRecordDecl *RD,
CXXDInfo.CXXClassInfo.bases = BaseList.getBases(); CXXDInfo.CXXClassInfo.bases = BaseList.getBases();
CXXDInfo.CXXClassInfo.numBases = BaseList.getNumBases(); 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); return handleDecl(OrigD, OrigD->getLocation(), getCursor(OrigD), CXXDInfo);
} }