summaryrefslogtreecommitdiffstats
path: root/clang/test/Index
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2017-09-22 16:58:57 +0000
committerDave Lee <davelee.com@gmail.com>2017-09-22 16:58:57 +0000
commit1a532c9e1dee0f898be16bf2ae84d5b798f25d28 (patch)
tree9d833023c353a290d44648563475c667864d0cea /clang/test/Index
parent8c4d061562c3bf2ffcb8c0e73b41f92e034461d0 (diff)
downloadbcm5719-llvm-1a532c9e1dee0f898be16bf2ae84d5b798f25d28.tar.gz
bcm5719-llvm-1a532c9e1dee0f898be16bf2ae84d5b798f25d28.zip
[index] Generate class & metaclass manglings for objc
Summary: ObjC classes have two associated symbols, one for the class and one for the metaclass. This change overloads `CodegenNameGenerator::getAllManglings` to produce both class and metaclass symbols. While this function is called by `clang_Cursor_getCXXManglings`, it's only called for CXXRecordDecl and CXXMethodDecl, and so libclang's behavior is unchanged. Reviewers: arphaman, abdulras, alexshap, compnerd Reviewed By: compnerd Subscribers: compnerd Differential Revision: https://reviews.llvm.org/D37671 llvm-svn: 313997
Diffstat (limited to 'clang/test/Index')
-rw-r--r--clang/test/Index/print-objc-manglings.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Index/print-objc-manglings.m b/clang/test/Index/print-objc-manglings.m
new file mode 100644
index 00000000000..1e7983ec617
--- /dev/null
+++ b/clang/test/Index/print-objc-manglings.m
@@ -0,0 +1,18 @@
+// RUN: c-index-test -write-pch %t.macho.ast -target i686-apple-darwin %s
+// RUN: c-index-test -test-print-manglings %t.macho.ast | FileCheck --check-prefix=MACHO %s
+
+// RUN: c-index-test -write-pch %t.itanium.ast -target i686-pc-linux-gnu %s
+// RUN: c-index-test -test-print-manglings %t.itanium.ast | FileCheck --check-prefix=ITANIUM %s
+
+@interface C
+@end
+
+// MACHO: ObjCInterfaceDecl=C{{.*}} [mangled=_OBJC_CLASS_$_C] [mangled=_OBJC_METACLASS_$_C]
+// ITANIUM: ObjCInterfaceDecl=C{{.*}} [mangled=_OBJC_CLASS_C] [mangled=_OBJC_METACLASS_C]
+
+@implementation C
+@end
+
+// MACHO: ObjCImplementationDecl=C{{.*}} (Definition) [mangled=_OBJC_CLASS_$_C] [mangled=_OBJC_METACLASS_$_C]
+// ITANIUM: ObjCImplementationDecl=C{{.*}} (Definition) [mangled=_OBJC_CLASS_C] [mangled=_OBJC_METACLASS_C]
+
OpenPOWER on IntegriCloud