forked from OSchip/llvm-project
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:
parent
5c26eeefdd
commit
63b15c3af7
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue