diff options
author | Alexander Potapenko <glider@google.com> | 2012-11-12 14:49:58 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2012-11-12 14:49:58 +0000 |
commit | dece7039dd40eea928ec10abc1e310a846b68dd7 (patch) | |
tree | a7582d6125fa9df287b24d2dfca9ed607d77693b /tools/llvm-symbolizer | |
parent | 1faf9be56923d4b877e52caeac3aabf6052962b1 (diff) |
Don't use __cxa_demangle under MSVC (which doesn't have it)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-symbolizer')
-rw-r--r-- | tools/llvm-symbolizer/llvm-symbolizer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/llvm-symbolizer/llvm-symbolizer.cpp b/tools/llvm-symbolizer/llvm-symbolizer.cpp index 79bdcedd3b..f3e365981e 100644 --- a/tools/llvm-symbolizer/llvm-symbolizer.cpp +++ b/tools/llvm-symbolizer/llvm-symbolizer.cpp @@ -287,9 +287,11 @@ static ModuleInfo *getOrCreateModuleInfo(const std::string &ModuleName) { return Info; } -// Assume that __cxa_demangle is provided by libcxxabi. +#if !defined(_MSC_VER) +// Assume that __cxa_demangle is provided by libcxxabi (except for Windows). extern "C" char *__cxa_demangle(const char *mangled_name, char *output_buffer, size_t *length, int *status); +#endif static void printDILineInfo(DILineInfo LineInfo) { // By default, DILineInfo contains "<invalid>" for function/filename it @@ -300,6 +302,7 @@ static void printDILineInfo(DILineInfo LineInfo) { std::string FunctionName = LineInfo.getFunctionName(); if (FunctionName == kDILineInfoBadString) FunctionName = kSymbolizerBadString; +#if !defined(_MSC_VER) if (Demangle) { int status = 0; char *DemangledName = __cxa_demangle( @@ -309,6 +312,7 @@ static void printDILineInfo(DILineInfo LineInfo) { free(DemangledName); } } +#endif outs() << FunctionName << "\n"; } std::string Filename = LineInfo.getFileName(); |