]> granicus.if.org Git - clang/commitdiff
[libclang] Since an objc extension semantically continues the interface of the class
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 18 Oct 2011 16:50:06 +0000 (16:50 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 18 Oct 2011 16:50:06 +0000 (16:50 +0000)
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142361 91177308-0d34-0410-b5e6-96231b3b80d8

test/Index/usrs.m
tools/libclang/CIndexUSRs.cpp

index 826abb53f37c774827ebefca4871afe97222d164..a76394b746c8ff8570eb08200b4246ba657ec5d7 100644 (file)
@@ -118,9 +118,9 @@ int test_multi_declaration(void) {
 // CHECK: usrs.m c:usrs.m@551@F@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@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@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@Bar Extent=[60:1 - 62:5]
 // CHECK: usrs.m c:objc(cs)CWithExt(im)meth4 Extent=[61:1 - 61:14]
index 195463cbe28752b605084f11c071943144873201..f6e9aa358e2202342d88e823b90a85d10bf6fc4e 100644 (file)
@@ -336,11 +336,9 @@ void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) {
         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());