getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location.

llvm-svn: 93520
This commit is contained in:
Ted Kremenek 2010-01-15 18:24:18 +00:00
parent 5c26eeefdd
commit 63b15c3af7
1 changed files with 4 additions and 0 deletions

View File

@ -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)) {