[cfe-commits] r133306 - in /cfe/trunk: lib/AST/ItaniumMangle.cpp test/CodeGenObjCXX/arc-mangle.mm
Douglas Gregor
dgregor at apple.com
Fri Jun 17 15:26:50 PDT 2011
Author: dgregor
Date: Fri Jun 17 17:26:49 2011
New Revision: 133306
URL: http://llvm.org/viewvc/llvm-project?rev=133306&view=rev
Log:
Objective-C++ ARC: do not mangle __unsafe_unretained lifetime
qualifiers, so that an __unsafe_unretained-qualified type T in ARC code
will have the same mangling as T in non-ARC code, improving ABI
interoperability. This works now because we infer or require a
lifetime qualifier everywhere one can appear in an external
interface. Another part of <rdar://problem/9595486>.
Modified:
cfe/trunk/lib/AST/ItaniumMangle.cpp
cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm
Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=133306&r1=133305&r2=133306&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Fri Jun 17 17:26:49 2011
@@ -1472,7 +1472,6 @@
// <type> ::= U "__strong"
// <type> ::= U "__weak"
// <type> ::= U "__autoreleasing"
- // <type> ::= U "__unsafe_unretained"
case Qualifiers::OCL_None:
break;
@@ -1489,7 +1488,13 @@
break;
case Qualifiers::OCL_ExplicitNone:
- LifetimeName = "__unsafe_unretained";
+ // The __unsafe_unretained qualifier is *not* mangled, so that
+ // __unsafe_unretained types in ARC produce the same manglings as the
+ // equivalent (but, naturally, unqualified) types in non-ARC, providing
+ // better ABI compatibility.
+ //
+ // It's safe to do this because unqualified 'id' won't show up
+ // in any type signatures that need to be mangled.
break;
}
if (!LifetimeName.empty())
Modified: cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm?rev=133306&r1=133305&r2=133306&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm Fri Jun 17 17:26:49 2011
@@ -6,7 +6,7 @@
void f(__weak id *) {}
// CHECK: define void @_Z1fPU15__autoreleasingP11objc_object(i8**)
void f(__autoreleasing id *) {}
-// CHECK: define void @_Z1fPU19__unsafe_unretainedP11objc_object(i8**)
+// CHECK: define void @_Z1fPP11objc_object(i8**)
void f(__unsafe_unretained id *) {}
// CHECK: define void @_Z1fPKU8__strongP11objc_object(i8**)
void f(const __strong id *) {}
@@ -14,7 +14,7 @@
void f(const __weak id *) {}
// CHECK: define void @_Z1fPKU15__autoreleasingP11objc_object(i8**)
void f(const __autoreleasing id *) {}
-// CHECK: define void @_Z1fPKU19__unsafe_unretainedP11objc_object(i8**)
+// CHECK: define void @_Z1fPKP11objc_object(i8**)
void f(const __unsafe_unretained id *) {}
More information about the cfe-commits
mailing list