summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-11-12 20:21:20 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-11-12 20:21:20 +0000
commit0e76a16200d5b8cb1e8202edcda4d45c01db2d56 (patch)
tree2c2704877ce3b3fabc45aee115af45c8a9462d29 /llvm/lib/CodeGen
parenta11b32b7e5f959020a8b4b05916895e5c97016ef (diff)
downloadbcm5719-llvm-0e76a16200d5b8cb1e8202edcda4d45c01db2d56.tar.gz
bcm5719-llvm-0e76a16200d5b8cb1e8202edcda4d45c01db2d56.zip
Temporary fix for PR21528 - use mangled C++ function names in COFF debug info to un-break ASan on Windows
llvm-svn: 221813
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp b/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
index 96cf55e7d32..b5e0929efd9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
@@ -190,7 +190,14 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
return;
assert(FI.End && "Don't know where the function ends?");
- const StringRef FuncName = getDISubprogram(GV).getDisplayName();
+ StringRef FuncName = getDISubprogram(GV).getDisplayName(),
+ GVName = GV->getName();
+ // FIXME Clang currently sets DisplayName to "bar" for a C++
+ // "namespace_foo::bar" function, see PR21528. Luckily, dbghelp.dll is trying
+ // to demangle display names anyways, so let's just put a mangled name into
+ // the symbols subsection until Clang gives us what we need.
+ if (GVName.startswith("\01?"))
+ FuncName = GVName.substr(1);
// Emit a symbol subsection, required by VS2012+ to find function boundaries.
MCSymbol *SymbolsBegin = Asm->MMI->getContext().CreateTempSymbol(),
*SymbolsEnd = Asm->MMI->getContext().CreateTempSymbol();
OpenPOWER on IntegriCloud