diff options
| author | Joerg Sonnenberger <joerg@bec.de> | 2013-04-27 22:12:32 +0000 |
|---|---|---|
| committer | Joerg Sonnenberger <joerg@bec.de> | 2013-04-27 22:12:32 +0000 |
| commit | 66241831dc9d33af810895cd622174cb9bdc6e4c (patch) | |
| tree | b346a19627546a4861603c86c830e5e8b82aff42 /llvm/lib/Support | |
| parent | a39fe8c59e45dbee6407f1deb540815c162f0c68 (diff) | |
| download | bcm5719-llvm-66241831dc9d33af810895cd622174cb9bdc6e4c.tar.gz bcm5719-llvm-66241831dc9d33af810895cd622174cb9bdc6e4c.zip | |
Only use cxxabi.h's demangler, if it is actually available.
llvm-svn: 180684
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 66338f17d88..1f8c8158d7f 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -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); |

