[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Argyrios Kyrtzidis 2011-10-18 16:50:06 +00:00
Родитель 341350ee62
Коммит 46d1ea40d7
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -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]

Просмотреть файл

@ -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());