mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-05 07:56:14 +00:00
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
This commit is contained in:
parent
a5c783280f
commit
7597a6252b
@ -225,7 +225,7 @@ DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
|
|||||||
AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
|
AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
|
||||||
ValuesSet(InitValuesSetSize), Values(), StringPool(), SectionMap(),
|
ValuesSet(InitValuesSetSize), Values(), StringPool(), SectionMap(),
|
||||||
SectionSourceLines(), didInitial(false), shouldEmit(false),
|
SectionSourceLines(), didInitial(false), shouldEmit(false),
|
||||||
FunctionDbgScope(0), DebugTimer(0) {
|
FunctionDbgScope(0), DebugTimer(0), LLVMMangler(0) {
|
||||||
if (TimePassesIsEnabled)
|
if (TimePassesIsEnabled)
|
||||||
DebugTimer = new Timer("Dwarf Debug Writer",
|
DebugTimer = new Timer("Dwarf Debug Writer",
|
||||||
getDwarfTimerGroup());
|
getDwarfTimerGroup());
|
||||||
@ -787,7 +787,7 @@ DIE *DwarfDebug::CreateGlobalVariableDIE(CompileUnit *DW_Unit,
|
|||||||
GV.getLinkageName(LinkageName);
|
GV.getLinkageName(LinkageName);
|
||||||
if (!LinkageName.empty())
|
if (!LinkageName.empty())
|
||||||
AddString(GVDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
|
AddString(GVDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
|
||||||
LinkageName);
|
LLVMMangler->makeNameProper(LinkageName));
|
||||||
AddType(DW_Unit, GVDie, GV.getType());
|
AddType(DW_Unit, GVDie, GV.getType());
|
||||||
if (!GV.isLocalToUnit())
|
if (!GV.isLocalToUnit())
|
||||||
AddUInt(GVDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);
|
AddUInt(GVDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);
|
||||||
@ -858,7 +858,7 @@ DIE *DwarfDebug::CreateSubprogramDIE(CompileUnit *DW_Unit,
|
|||||||
|
|
||||||
if (!LinkageName.empty())
|
if (!LinkageName.empty())
|
||||||
AddString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
|
AddString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
|
||||||
LinkageName);
|
LLVMMangler->makeNameProper(LinkageName));
|
||||||
|
|
||||||
AddSourceLine(SPDie, &SP);
|
AddSourceLine(SPDie, &SP);
|
||||||
|
|
||||||
@ -1278,6 +1278,16 @@ void DwarfDebug::BeginModule(Module *M, MachineModuleInfo *mmi) {
|
|||||||
SmallVector<GlobalVariable *, 4> SPs;
|
SmallVector<GlobalVariable *, 4> SPs;
|
||||||
CollectDebugInfoAnchors(*M, CUs, GVs, 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.
|
// Create all the compile unit DIEs.
|
||||||
for (SmallVector<GlobalVariable *, 2>::iterator I = CUs.begin(),
|
for (SmallVector<GlobalVariable *, 2>::iterator I = CUs.begin(),
|
||||||
E = CUs.end(); I != E; ++I)
|
E = CUs.end(); I != E; ++I)
|
||||||
@ -1408,6 +1418,8 @@ void DwarfDebug::EndModule() {
|
|||||||
|
|
||||||
if (TimePassesIsEnabled)
|
if (TimePassesIsEnabled)
|
||||||
DebugTimer->stopTimer();
|
DebugTimer->stopTimer();
|
||||||
|
|
||||||
|
delete LLVMMangler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// BeginFunction - Gather pre-function debug information. Assumes being
|
/// BeginFunction - Gather pre-function debug information. Assumes being
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "llvm/CodeGen/MachineLocation.h"
|
#include "llvm/CodeGen/MachineLocation.h"
|
||||||
#include "llvm/Analysis/DebugInfo.h"
|
#include "llvm/Analysis/DebugInfo.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/ADT/DenseMap.h"
|
#include "llvm/ADT/DenseMap.h"
|
||||||
#include "llvm/ADT/FoldingSet.h"
|
#include "llvm/ADT/FoldingSet.h"
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
@ -180,6 +181,8 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
|
|||||||
/// DebugTimer - Timer for the Dwarf debug writer.
|
/// DebugTimer - Timer for the Dwarf debug writer.
|
||||||
Timer *DebugTimer;
|
Timer *DebugTimer;
|
||||||
|
|
||||||
|
Mangler *LLVMMangler;
|
||||||
|
|
||||||
struct FunctionDebugFrameInfo {
|
struct FunctionDebugFrameInfo {
|
||||||
unsigned Number;
|
unsigned Number;
|
||||||
std::vector<MachineMove> Moves;
|
std::vector<MachineMove> Moves;
|
||||||
|
Loading…
Reference in New Issue
Block a user