From: Ted Kremenek Date: Fri, 15 Jan 2010 18:24:18 +0000 (+0000) Subject: getLocationFromCursor: If a cursor is a reference and has a referringDecl, using... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b456e841ea33b937ad6e5b2cccc0ca8173bf7bb;p=clang getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93520 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 86e0ddc202..f24a742593 100644 --- a/tools/CIndex/CIndex.cpp +++ b/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(C.referringDecl)) + return D->getLocation(); + switch (C.kind) { case CXCursor_ObjCClassRef: { if (isa(ND)) {