From f8d44de1438a22c1755b27a0e91dc3b7b21bb7f2 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 8 Oct 2015 00:01:20 +0000 Subject: Make clang_Cursor_getMangling not 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 . llvm-svn: 249639 --- clang/tools/c-index-test/c-index-test.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/tools/c-index-test/c-index-test.c') diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index eeeb832cd87..346bcc65794 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_isUnexposed(clang_getCursorKind(cursor))) + return CXChildVisit_Recurse; CXString MangledName; PrintCursor(cursor, NULL); MangledName = clang_Cursor_getMangling(cursor); -- cgit v1.2.3