diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-10-14 17:20:18 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-10-14 17:20:18 +0000 |
commit | 3b43447619d815e1918e683318538a6f5cde087a (patch) | |
tree | a63dd5264305aa6c2daf3a19d613dd681549b1d3 /clang/lib/AST/Mangle.cpp | |
parent | 64ab4de44339d84e8ecf578e260b68aeb142187b (diff) | |
download | bcm5719-llvm-3b43447619d815e1918e683318538a6f5cde087a.tar.gz bcm5719-llvm-3b43447619d815e1918e683318538a6f5cde087a.zip |
CodeGen: correct block mangling in ObjC
Mangling for blocks defined within blocks in an ObjectiveC context were also
broken by SVN r219393. Because the code in mangleName assumed that the code was
either C or C++, we would trigger assertions when trying to mangle the inner
blocks in an ObjectiveC context.
Add a test and use the ObjectiveC specific mangling when dealing with an
ObjectiveC method declaration.
llvm-svn: 219697
Diffstat (limited to 'clang/lib/AST/Mangle.cpp')
-rw-r--r-- | clang/lib/AST/Mangle.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp index fba835451e2..b5dbdca9c97 100644 --- a/clang/lib/AST/Mangle.cpp +++ b/clang/lib/AST/Mangle.cpp @@ -135,7 +135,10 @@ void MangleContext::mangleName(const NamedDecl *D, raw_ostream &Out) { bool MCXX = shouldMangleCXXName(D); const TargetInfo &TI = Context.getTargetInfo(); if (CC == SOF_OTHER || (MCXX && TI.getCXXABI() == TargetCXXABI::Microsoft)) { - mangleCXXName(D, Out); + if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) + mangleObjCMethodName(OMD, Out); + else + mangleCXXName(D, Out); return; } @@ -147,6 +150,8 @@ void MangleContext::mangleName(const NamedDecl *D, raw_ostream &Out) { if (!MCXX) Out << D->getIdentifier()->getName(); + else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) + mangleObjCMethodName(OMD, Out); else mangleCXXName(D, Out); |