summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-11-22 16:17:20 +0000
committerTim Northover <tnorthover@apple.com>2016-11-22 16:17:20 +0000
commitb64fb453eaf3c2d768538571b2d99b4c5acf8911 (patch)
tree5caa3f2fde0a3e51156f873257f7f48f1dc6522f /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent9a355219d19b316f3f5baa093164ca554e7af17e (diff)
downloadbcm5719-llvm-b64fb453eaf3c2d768538571b2d99b4c5acf8911.tar.gz
bcm5719-llvm-b64fb453eaf3c2d768538571b2d99b4c5acf8911.zip
CodeGen: simplify TargetMachine::getSymbol interface. NFC.
No-one actually had a mangler handy when calling this function, and getSymbol itself went most of the way towards getting its own mangler (with a local TLOF variable) so forcing all callers to supply one was just extra complication. llvm-svn: 287645
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 539d485ffef..bdb1210553e 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -55,9 +55,9 @@ MCSymbol *TargetLoweringObjectFileELF::getCFIPersonalitySymbol(
unsigned Encoding = getPersonalityEncoding();
if ((Encoding & 0x80) == dwarf::DW_EH_PE_indirect)
return getContext().getOrCreateSymbol(StringRef("DW.ref.") +
- TM.getSymbol(GV, getMangler())->getName());
+ TM.getSymbol(GV)->getName());
if ((Encoding & 0x70) == dwarf::DW_EH_PE_absptr)
- return TM.getSymbol(GV, getMangler());
+ return TM.getSymbol(GV);
report_fatal_error("We do not support this DWARF encoding yet!");
}
@@ -96,7 +96,7 @@ const MCExpr *TargetLoweringObjectFileELF::getTTypeGlobalReference(
// gets emitted by the asmprinter.
MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
if (!StubSym.getPointer()) {
- MCSymbol *Sym = TM.getSymbol(GV, getMangler());
+ MCSymbol *Sym = TM.getSymbol(GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
@@ -443,10 +443,9 @@ const MCExpr *TargetLoweringObjectFileELF::lowerRelativeReference(
return nullptr;
return MCBinaryExpr::createSub(
- MCSymbolRefExpr::create(TM.getSymbol(LHS, getMangler()), PLTRelativeVariantKind,
+ MCSymbolRefExpr::create(TM.getSymbol(LHS), PLTRelativeVariantKind,
getContext()),
- MCSymbolRefExpr::create(TM.getSymbol(RHS, getMangler()), getContext()),
- getContext());
+ MCSymbolRefExpr::create(TM.getSymbol(RHS), getContext()), getContext());
}
void
@@ -712,7 +711,7 @@ const MCExpr *TargetLoweringObjectFileMachO::getTTypeGlobalReference(
// gets emitted by the asmprinter.
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(SSym);
if (!StubSym.getPointer()) {
- MCSymbol *Sym = TM.getSymbol(GV, getMangler());
+ MCSymbol *Sym = TM.getSymbol(GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
@@ -738,7 +737,7 @@ MCSymbol *TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(
// gets emitted by the asmprinter.
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(SSym);
if (!StubSym.getPointer()) {
- MCSymbol *Sym = TM.getSymbol(GV, getMangler());
+ MCSymbol *Sym = TM.getSymbol(GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
@@ -929,7 +928,7 @@ MCSection *TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(
ComdatGV = GO;
if (!ComdatGV->hasPrivateLinkage()) {
- MCSymbol *Sym = TM.getSymbol(ComdatGV, getMangler());
+ MCSymbol *Sym = TM.getSymbol(ComdatGV);
COMDATSymName = Sym->getName();
Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
} else {
@@ -982,7 +981,7 @@ MCSection *TargetLoweringObjectFileCOFF::SelectSectionForGlobal(
UniqueID = NextUniqueID++;
if (!ComdatGV->hasPrivateLinkage()) {
- MCSymbol *Sym = TM.getSymbol(ComdatGV, getMangler());
+ MCSymbol *Sym = TM.getSymbol(ComdatGV);
StringRef COMDATSymName = Sym->getName();
return getContext().getCOFFSection(Name, Characteristics, Kind,
COMDATSymName, Selection, UniqueID);
@@ -1037,7 +1036,7 @@ MCSection *TargetLoweringObjectFileCOFF::getSectionForJumpTable(
if (F.hasPrivateLinkage())
return ReadOnlySection;
- MCSymbol *Sym = TM.getSymbol(&F, getMangler());
+ MCSymbol *Sym = TM.getSymbol(&F);
StringRef COMDATSymName = Sym->getName();
SectionKind Kind = SectionKind::getReadOnly();
OpenPOWER on IntegriCloud