summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2015-10-06 18:24:33 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2015-10-06 18:24:33 +0000
commit9d1f05aef8a0e39105e39e5ac4be4bfee03a1a52 (patch)
tree15a8d1ce213671ad0c8bfd826b9b3f638445d013 /clang/tools/c-index-test/c-index-test.c
parent33bb1a23b334133966976ea44741e1c7253c3267 (diff)
downloadbcm5719-llvm-9d1f05aef8a0e39105e39e5ac4be4bfee03a1a52.tar.gz
bcm5719-llvm-9d1f05aef8a0e39105e39e5ac4be4bfee03a1a52.zip
Make clang_Cursor_getMangling don't mangle if the declaration isn't mangled
Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern "C"). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249437
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index eeeb832cd87..6292f73068c 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -1429,6 +1429,8 @@ static enum CXChildVisitResult PrintTypeSize(CXCursor cursor, CXCursor p,
static enum CXChildVisitResult PrintMangledName(CXCursor cursor, CXCursor p,
CXClientData d) {
+ if (clang_isInvalid(clang_getCursorKind(cursor)))
+ return CXChildVisit_Recurse;
CXString MangledName;
PrintCursor(cursor, NULL);
MangledName = clang_Cursor_getMangling(cursor);
OpenPOWER on IntegriCloud