aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ItaniumMangle.cpp9
-rw-r--r--test/CodeGenObjCXX/arc-mangle.mm4
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp
index a77fe5f48a..5f0b2a6eff 100644
--- a/lib/AST/ItaniumMangle.cpp
+++ b/lib/AST/ItaniumMangle.cpp
@@ -1472,7 +1472,6 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals) {
// <type> ::= U "__strong"
// <type> ::= U "__weak"
// <type> ::= U "__autoreleasing"
- // <type> ::= U "__unsafe_unretained"
case Qualifiers::OCL_None:
break;
@@ -1489,7 +1488,13 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals) {
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())
diff --git a/test/CodeGenObjCXX/arc-mangle.mm b/test/CodeGenObjCXX/arc-mangle.mm
index 628144f04c..20af4dfcca 100644
--- a/test/CodeGenObjCXX/arc-mangle.mm
+++ b/test/CodeGenObjCXX/arc-mangle.mm
@@ -6,7 +6,7 @@ void f(__strong id *) {}
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 __strong id *) {}
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 *) {}