summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-08 03:04:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-08 03:04:33 +0000
commit95c0feb5e0aa8cefa660bb74bebcecfd2b6045e5 (patch)
tree295804e342fcc667ee0eead40b9c585426c9d726
parent0ee8c513f7e6a417b1259e6705b36a0efa91e214 (diff)
downloadbcm5719-llvm-95c0feb5e0aa8cefa660bb74bebcecfd2b6045e5.tar.gz
bcm5719-llvm-95c0feb5e0aa8cefa660bb74bebcecfd2b6045e5.zip
[libclang] Indexing: When suppressing references, suppress references
of bases in C++ classes. rdar://10768707 llvm-svn: 150048
-rw-r--r--clang/tools/libclang/IndexingContext.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp
index 2e69c468494..059d8425159 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);
}
OpenPOWER on IntegriCloud