diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-06-17 22:26:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-06-17 22:26:49 +0000 |
commit | c22d699d3aa1d7fbd32c4e35cf75abdca94bb5ef (patch) | |
tree | 529f935c21533937f89cc07231049b8f7532169b /lib/AST/ItaniumMangle.cpp | |
parent | 54fb28ad4a3474845b2b812ac2966f75d5570c17 (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | lib/AST/ItaniumMangle.cpp | 9 |
1 files changed, 7 insertions, 2 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()) |