mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-12 17:25:49 +00:00
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
This commit is contained in:
@@ -287,9 +287,11 @@ static ModuleInfo *getOrCreateModuleInfo(const std::string &ModuleName) {
|
|||||||
return Info;
|
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,
|
extern "C" char *__cxa_demangle(const char *mangled_name, char *output_buffer,
|
||||||
size_t *length, int *status);
|
size_t *length, int *status);
|
||||||
|
#endif
|
||||||
|
|
||||||
static void printDILineInfo(DILineInfo LineInfo) {
|
static void printDILineInfo(DILineInfo LineInfo) {
|
||||||
// By default, DILineInfo contains "<invalid>" for function/filename it
|
// By default, DILineInfo contains "<invalid>" for function/filename it
|
||||||
@@ -300,6 +302,7 @@ static void printDILineInfo(DILineInfo LineInfo) {
|
|||||||
std::string FunctionName = LineInfo.getFunctionName();
|
std::string FunctionName = LineInfo.getFunctionName();
|
||||||
if (FunctionName == kDILineInfoBadString)
|
if (FunctionName == kDILineInfoBadString)
|
||||||
FunctionName = kSymbolizerBadString;
|
FunctionName = kSymbolizerBadString;
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
if (Demangle) {
|
if (Demangle) {
|
||||||
int status = 0;
|
int status = 0;
|
||||||
char *DemangledName = __cxa_demangle(
|
char *DemangledName = __cxa_demangle(
|
||||||
@@ -309,6 +312,7 @@ static void printDILineInfo(DILineInfo LineInfo) {
|
|||||||
free(DemangledName);
|
free(DemangledName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
outs() << FunctionName << "\n";
|
outs() << FunctionName << "\n";
|
||||||
}
|
}
|
||||||
std::string Filename = LineInfo.getFileName();
|
std::string Filename = LineInfo.getFileName();
|
||||||
|
Reference in New Issue
Block a user