summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Mangle.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-03-07 09:26:07 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-03-07 09:26:07 +0000
commita166a2b633f6d38d07b1f97ce196354bcb08b168 (patch)
tree6e8ba252fa4638ebe2ec0dc389818af2724296ca /clang/lib/AST/Mangle.cpp
parent63cfb16b93d927bd36843531bdec53d66746cbef (diff)
downloadbcm5719-llvm-a166a2b633f6d38d07b1f97ce196354bcb08b168.tar.gz
bcm5719-llvm-a166a2b633f6d38d07b1f97ce196354bcb08b168.zip
[AST/ObjC] Make ObjCCategoryImplDecl consistent with ObjCCategoryDecl and use the category name as its DeclName
This also addresses the badness in ObjCCategoryImplDecl's API, which was hiding NamedDecl's APIs with different meaning. llvm-svn: 297131
Diffstat (limited to 'clang/lib/AST/Mangle.cpp')
-rw-r--r--clang/lib/AST/Mangle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp
index 05dd886adce..00d50c0e3bd 100644
--- a/clang/lib/AST/Mangle.cpp
+++ b/clang/lib/AST/Mangle.cpp
@@ -262,9 +262,13 @@ void MangleContext::mangleObjCMethodNameWithoutSize(const ObjCMethodDecl *MD,
const ObjCContainerDecl *CD =
dyn_cast<ObjCContainerDecl>(MD->getDeclContext());
assert (CD && "Missing container decl in GetNameForMethod");
- OS << (MD->isInstanceMethod() ? '-' : '+') << '[' << CD->getName();
- if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(CD))
+ OS << (MD->isInstanceMethod() ? '-' : '+') << '[';
+ if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(CD)) {
+ OS << CID->getClassInterface()->getName();
OS << '(' << *CID << ')';
+ } else {
+ OS << CD->getName();
+ }
OS << ' ';
MD->getSelector().print(OS);
OS << ']';
OpenPOWER on IntegriCloud