diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-01-15 18:24:18 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-01-15 18:24:18 +0000 |
| commit | 63b15c3af73ee30a0fc98adaecd9494d76da2ad7 (patch) | |
| tree | 9aa33aa9bb63c87dc8db99d9eb2a6a0cb852c05d | |
| parent | 5c26eeefdd5748cae1ebe6df5cfcca7a007d909b (diff) | |
| download | bcm5719-llvm-63b15c3af73ee30a0fc98adaecd9494d76da2ad7.tar.gz bcm5719-llvm-63b15c3af73ee30a0fc98adaecd9494d76da2ad7.zip | |
getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location.
llvm-svn: 93520
| -rw-r--r-- | clang/tools/CIndex/CIndex.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp index 86e0ddc2020..f24a7425936 100644 --- a/clang/tools/CIndex/CIndex.cpp +++ b/clang/tools/CIndex/CIndex.cpp @@ -409,6 +409,10 @@ static SourceLocation getLocationFromCursor(CXCursor C, SourceManager &SourceMgr, NamedDecl *ND) { if (clang_isReference(C.kind)) { + + if (Decl *D = static_cast<Decl*>(C.referringDecl)) + return D->getLocation(); + switch (C.kind) { case CXCursor_ObjCClassRef: { if (isa<ObjCInterfaceDecl>(ND)) { |

