diff options
author | Devang Patel <dpatel@apple.com> | 2009-07-13 21:19:56 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-07-13 21:19:56 +0000 |
commit | 7597a6252b29f76c7e65351ef85918d1769713bb (patch) | |
tree | bdacdbbf029d99814fb39e99ffcd2acfedd5d97a | |
parent | a5c783280f83df5c60a8ed9e32c61b05a11048e3 (diff) | |
download | external_llvm-7597a6252b29f76c7e65351ef85918d1769713bb.zip external_llvm-7597a6252b29f76c7e65351ef85918d1769713bb.tar.gz external_llvm-7597a6252b29f76c7e65351ef85918d1769713bb.tar.bz2 |
Use Mangler to remove leading '1' from linkage names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75503 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 18 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.h | 5 |
2 files changed, 19 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 32f5673..dab9957 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -225,7 +225,7 @@ DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(), ValuesSet(InitValuesSetSize), Values(), StringPool(), SectionMap(), SectionSourceLines(), didInitial(false), shouldEmit(false), - FunctionDbgScope(0), DebugTimer(0) { + FunctionDbgScope(0), DebugTimer(0), LLVMMangler(0) { if (TimePassesIsEnabled) DebugTimer = new Timer("Dwarf Debug Writer", getDwarfTimerGroup()); @@ -787,7 +787,7 @@ DIE *DwarfDebug::CreateGlobalVariableDIE(CompileUnit *DW_Unit, GV.getLinkageName(LinkageName); if (!LinkageName.empty()) AddString(GVDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string, - LinkageName); + LLVMMangler->makeNameProper(LinkageName)); AddType(DW_Unit, GVDie, GV.getType()); if (!GV.isLocalToUnit()) AddUInt(GVDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1); @@ -858,7 +858,7 @@ DIE *DwarfDebug::CreateSubprogramDIE(CompileUnit *DW_Unit, if (!LinkageName.empty()) AddString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string, - LinkageName); + LLVMMangler->makeNameProper(LinkageName)); AddSourceLine(SPDie, &SP); @@ -1278,6 +1278,16 @@ void DwarfDebug::BeginModule(Module *M, MachineModuleInfo *mmi) { SmallVector<GlobalVariable *, 4> SPs; CollectDebugInfoAnchors(*M, CUs, GVs, SPs); + LLVMMangler = new Mangler(*M, TAI->getGlobalPrefix()); + // add chars used in ObjC method names so method names aren't mangled + LLVMMangler->markCharAcceptable('['); + LLVMMangler->markCharAcceptable(']'); + LLVMMangler->markCharAcceptable('('); + LLVMMangler->markCharAcceptable(')'); + LLVMMangler->markCharAcceptable('-'); + LLVMMangler->markCharAcceptable('+'); + LLVMMangler->markCharAcceptable(' '); + // Create all the compile unit DIEs. for (SmallVector<GlobalVariable *, 2>::iterator I = CUs.begin(), E = CUs.end(); I != E; ++I) @@ -1408,6 +1418,8 @@ void DwarfDebug::EndModule() { if (TimePassesIsEnabled) DebugTimer->stopTimer(); + + delete LLVMMangler; } /// BeginFunction - Gather pre-function debug information. Assumes being diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index a4072f5..78260e5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -20,6 +20,7 @@ #include "llvm/CodeGen/MachineLocation.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Mangler.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/SmallSet.h" @@ -179,7 +180,9 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf { /// DebugTimer - Timer for the Dwarf debug writer. Timer *DebugTimer; - + + Mangler *LLVMMangler; + struct FunctionDebugFrameInfo { unsigned Number; std::vector<MachineMove> Moves; |