diff options
author | Timur Iskhodzhanov <timurrrr@google.com> | 2014-11-12 20:21:20 +0000 |
---|---|---|
committer | Timur Iskhodzhanov <timurrrr@google.com> | 2014-11-12 20:21:20 +0000 |
commit | 0e76a16200d5b8cb1e8202edcda4d45c01db2d56 (patch) | |
tree | 2c2704877ce3b3fabc45aee115af45c8a9462d29 /llvm/lib | |
parent | a11b32b7e5f959020a8b4b05916895e5c97016ef (diff) | |
download | bcm5719-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')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp | 9 |
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(); |