[llvm] r180684 - Only use cxxabi.h's demangler, if it is actually available.

Joerg Sonnenberger joerg at bec.de
Sat Apr 27 15:12:33 PDT 2013


Author: joerg
Date: Sat Apr 27 17:12:32 2013
New Revision: 180684

URL: http://llvm.org/viewvc/llvm-project?rev=180684&view=rev
Log:
Only use cxxabi.h's demangler, if it is actually available.

Modified:
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/cmake/config-ix.cmake
    llvm/trunk/configure
    llvm/trunk/include/llvm/Config/config.h.cmake
    llvm/trunk/include/llvm/Config/config.h.in
    llvm/trunk/lib/Support/Unix/Signals.inc

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=180684&r1=180683&r2=180684&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Sat Apr 27 17:12:32 2013
@@ -1507,7 +1507,7 @@ AC_HEADER_STAT
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 
-AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
+AC_CHECK_HEADERS([cxxabi.h dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
 AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h termios.h unistd.h])
 AC_CHECK_HEADERS([utime.h windows.h])
 AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h sys/uio.h])

Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=180684&r1=180683&r2=180684&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Sat Apr 27 17:12:32 2013
@@ -37,6 +37,7 @@ endfunction()
 check_include_file(argz.h HAVE_ARGZ_H)
 check_include_file(assert.h HAVE_ASSERT_H)
 check_include_file(ctype.h HAVE_CTYPE_H)
+check_include_file(cxxabi.h HAVE_CXXABI_H)
 check_include_file(dirent.h HAVE_DIRENT_H)
 check_include_file(dl.h HAVE_DL_H)
 check_include_file(dld.h HAVE_DLD_H)

Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=180684&r1=180683&r2=180684&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Sat Apr 27 17:12:32 2013
@@ -14868,7 +14868,7 @@ fi
 
 
 
-for ac_header in dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h
+for ac_header in cxxabi.h dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then

Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=180684&r1=180683&r2=180684&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Sat Apr 27 17:12:32 2013
@@ -69,6 +69,9 @@
 /* Define to 1 if you have the `closedir' function. */
 #cmakedefine HAVE_CLOSEDIR ${HAVE_CLOSEDIR}
 
+/* Define to 1 if you have the <cxxabi.h> header file. */
+#cmakedefine HAVE_CXXABI_H ${HAVE_CXXABI_H}
+
 /* Define to 1 if you have the <CrashReporterClient.h> header file. */
 #undef HAVE_CRASHREPORTERCLIENT_H
 

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=180684&r1=180683&r2=180684&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Sat Apr 27 17:12:32 2013
@@ -69,6 +69,9 @@
 /* Define to 1 if you have the `closedir' function. */
 #undef HAVE_CLOSEDIR
 
+/* Define to 1 if you have the <cxxabi.h> header file. */
+#undef HAVE_CXXABI_H
+
 /* Define to 1 if you have the <CrashReporterClient.h> header file. */
 #undef HAVE_CRASHREPORTERCLIENT_H
 

Modified: llvm/trunk/lib/Support/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Signals.inc?rev=180684&r1=180683&r2=180684&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc (original)
+++ llvm/trunk/lib/Support/Unix/Signals.inc Sat Apr 27 17:12:32 2013
@@ -27,9 +27,11 @@
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#if HAVE_DLFCN_H && __GNUG__
+#if HAVE_CXXABI_H
+#include cxxabi.h>
+#endif
+#if HAVE_DLFCN_H
 #include <dlfcn.h>
-#include <cxxabi.h>
 #endif
 #if HAVE_MACH_MACH_H
 #include <mach/mach.h>
@@ -292,7 +294,11 @@ void llvm::sys::PrintStackTrace(FILE *FD
     if (dlinfo.dli_sname != NULL) {
       int res;
       fputc(' ', FD);
+#  if HAVE_CXXABI_H
       char* d = abi::__cxa_demangle(dlinfo.dli_sname, NULL, NULL, &res);
+#  else
+      char* d = NULL;
+#  endif
       if (d == NULL) fputs(dlinfo.dli_sname, FD);
       else           fputs(d, FD);
       free(d);





More information about the llvm-commits mailing list