summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ItaniumMangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-06-17 22:26:49 +0000
committerDouglas Gregor <dgregor@apple.com>2011-06-17 22:26:49 +0000
commitb5176a5328fbee9c0dfaa12fe485a8bbc12e98f7 (patch)
tree38e3785e6295d24ea40565942706be68928f7dcc /clang/lib/AST/ItaniumMangle.cpp
parentc3dfb5fa89a88ea7e1ec37d5bfde66dbbf0dc738 (diff)
downloadbcm5719-llvm-b5176a5328fbee9c0dfaa12fe485a8bbc12e98f7.tar.gz
bcm5719-llvm-b5176a5328fbee9c0dfaa12fe485a8bbc12e98f7.zip
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>. llvm-svn: 133306
Diffstat (limited to 'clang/lib/AST/ItaniumMangle.cpp')
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index a77fe5f48ab..5f0b2a6eff8 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/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())
OpenPOWER on IntegriCloud