[cfe-commits] r93520 - /cfe/trunk/tools/CIndex/CIndex.cpp

Ted Kremenek kremenek at apple.com
Fri Jan 15 10:24:18 PST 2010


Author: kremenek
Date: Fri Jan 15 12:24:18 2010
New Revision: 93520

URL: http://llvm.org/viewvc/llvm-project?rev=93520&view=rev
Log:
getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location.

Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=93520&r1=93519&r2=93520&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Fri Jan 15 12:24:18 2010
@@ -409,6 +409,10 @@
                                             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)) {





More information about the cfe-commits mailing list