[llvm-commits] [llvm] r75503 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h
Devang Patel
dpatel at apple.com
Mon Jul 13 14:19:56 PDT 2009
Author: dpatel
Date: Mon Jul 13 16:19:56 2009
New Revision: 75503
URL: http://llvm.org/viewvc/llvm-project?rev=75503&view=rev
Log:
Use Mangler to remove leading '1' from linkage names.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=75503&r1=75502&r2=75503&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jul 13 16:19:56 2009
@@ -225,7 +225,7 @@
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 @@
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 @@
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 @@
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 @@
if (TimePassesIsEnabled)
DebugTimer->stopTimer();
+
+ delete LLVMMangler;
}
/// BeginFunction - Gather pre-function debug information. Assumes being
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=75503&r1=75502&r2=75503&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Mon Jul 13 16:19:56 2009
@@ -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 @@
/// DebugTimer - Timer for the Dwarf debug writer.
Timer *DebugTimer;
-
+
+ Mangler *LLVMMangler;
+
struct FunctionDebugFrameInfo {
unsigned Number;
std::vector<MachineMove> Moves;
More information about the llvm-commits
mailing list