[cfe-commits] r142361 - in /cfe/trunk: test/Index/usrs.m tools/libclang/CIndexUSRs.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Oct 18 09:50:06 PDT 2011


Author: akirtzidis
Date: Tue Oct 18 11:50:06 2011
New Revision: 142361

URL: http://llvm.org/viewvc/llvm-project?rev=142361&view=rev
Log:
[libclang] Since an objc extension semantically continues the interface of the class
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.

Modified:
    cfe/trunk/test/Index/usrs.m
    cfe/trunk/tools/libclang/CIndexUSRs.cpp

Modified: cfe/trunk/test/Index/usrs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/usrs.m?rev=142361&r1=142360&r2=142361&view=diff
==============================================================================
--- cfe/trunk/test/Index/usrs.m (original)
+++ cfe/trunk/test/Index/usrs.m Tue Oct 18 11:50:06 2011
@@ -118,9 +118,9 @@
 // CHECK: usrs.m c:usrs.m at 551@F at local_func@x Extent=[49:23 - 49:28]
 // CHECK: usrs.m c:objc(cs)CWithExt Extent=[51:1 - 53:5]
 // CHECK: usrs.m c:objc(cs)CWithExt(im)meth1 Extent=[52:1 - 52:14]
-// CHECK: usrs.m c:objc(ext)CWithExt at usrs.m@612 Extent=[54:1 - 56:5]
+// CHECK: usrs.m c:objc(cs)CWithExt Extent=[54:1 - 56:5]
 // CHECK: usrs.m c:objc(cs)CWithExt(im)meth2 Extent=[55:1 - 55:14]
-// CHECK: usrs.m c:objc(ext)CWithExt at usrs.m@654 Extent=[57:1 - 59:5]
+// CHECK: usrs.m c:objc(cs)CWithExt Extent=[57:1 - 59:5]
 // CHECK: usrs.m c:objc(cs)CWithExt(im)meth3 Extent=[58:1 - 58:14]
 // CHECK: usrs.m c:objc(cy)CWithExt at Bar Extent=[60:1 - 62:5]
 // CHECK: usrs.m c:objc(cs)CWithExt(im)meth4 Extent=[61:1 - 61:14]

Modified: cfe/trunk/tools/libclang/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexUSRs.cpp?rev=142361&r1=142360&r2=142361&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexUSRs.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexUSRs.cpp Tue Oct 18 11:50:06 2011
@@ -336,11 +336,9 @@
         IgnoreResults = true;
         return;
       }
-      // Specially handle class extensions, which are anonymous categories.
-      // We want to mangle in the location to uniquely distinguish them.
       if (CD->IsClassExtension()) {
-        Out << "objc(ext)" << ID->getName() << '@';
-        GenLoc(CD);
+        // An extension semantically continues the interface of the class.
+        GenObjCClass(ID->getName());
       }
       else
         GenObjCCategory(ID->getName(), CD->getName());





More information about the cfe-commits mailing list