diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-05-25 14:15:08 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-05-25 14:15:08 +0000 |
commit | fb42078d7c1b1146483576ab9ef8b54ff0feb385 (patch) | |
tree | 63a4100ec4ba9314b8cec53d9041defe6ba09ef4 /clang/lib/AST/ItaniumMangle.cpp | |
parent | 0e871f0b66438abaec77f22c05e3ec41dd34234c (diff) | |
download | bcm5719-llvm-fb42078d7c1b1146483576ab9ef8b54ff0feb385.tar.gz bcm5719-llvm-fb42078d7c1b1146483576ab9ef8b54ff0feb385.zip |
Fix mangled name of method with ns_consumed parameters.
When a function/method use a parameter with "ns_consumed" attribute,
ensure that the mangled name is the same whether -fobjc-arc is used
or not.
Since "ns_consumed" attribute is generally used to inform ARC that
a function/method does sink the reference, it mean it is usually
implemented in a compilation unit compiled without -fobjc-arc but
used form a compilation unit compiled with it.
Originally found while trying to use "ns_consumed" attribute in an
Objective-C++ file in Chromium (http://crbug.com/599980) where it
caused a linker error.
Regression introduced by revision 262278 (previously the attribute
was incorrectly not part of the mangled name).
Patch from Sylvain Defresne <sdefresne@chromium.org>!
http://reviews.llvm.org/D20113
llvm-svn: 270702
Diffstat (limited to 'clang/lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | clang/lib/AST/ItaniumMangle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index 8d12105c71b..1d40d42c11d 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -2243,7 +2243,7 @@ void CXXNameMangler::mangleBareFunctionType(const FunctionProtoType *Proto, FunctionTypeDepth.enterResultType(); // Mangle ns_returns_retained as an order-sensitive qualifier here. - if (Proto->getExtInfo().getProducesResult()) + if (Proto->getExtInfo().getProducesResult() && FD == nullptr) mangleVendorQualifier("ns_returns_retained"); // Mangle the return type without any direct ARC ownership qualifiers. @@ -2269,7 +2269,7 @@ void CXXNameMangler::mangleBareFunctionType(const FunctionProtoType *Proto, assert(!FD || FD->getNumParams() == Proto->getNumParams()); for (unsigned I = 0, E = Proto->getNumParams(); I != E; ++I) { // Mangle extended parameter info as order-sensitive qualifiers here. - if (Proto->hasExtParameterInfos()) { + if (Proto->hasExtParameterInfos() && FD == nullptr) { mangleExtParameterInfo(Proto->getExtParameterInfo(I)); } @@ -3819,7 +3819,7 @@ void CXXNameMangler::mangleTemplateArg(TemplateArgument A) { Out << 'L'; // References to external entities use the mangled name; if the name would - // not normally be manged then mangle it as unqualified. + // not normally be mangled then mangle it as unqualified. mangle(D); Out << 'E'; |