Temporary fix for PR21528 - use mangled C++ function names in COFF debug info to un-break ASan on Windows

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Timur Iskhodzhanov
2014-11-12 20:21:20 +00:00
parent 629ba0ac0d
commit fc0d323d01
2 changed files with 51 additions and 1 deletions

View File

@@ -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();