aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-29 17:28:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-29 17:28:26 +0000
commit93cf0939f95b3d580d9c05375a7c84164e1ba72e (patch)
treea96b38da3a97d31cc718f361f15ab79fe2e12270 /lib/CodeGen
parentfaf4ed2da85b10eb0b6c506c4a642a2a9395786f (diff)
downloadexternal_llvm-93cf0939f95b3d580d9c05375a7c84164e1ba72e.zip
external_llvm-93cf0939f95b3d580d9c05375a7c84164e1ba72e.tar.gz
external_llvm-93cf0939f95b3d580d9c05375a7c84164e1ba72e.tar.bz2
Move getSymbol to TargetLoweringObjectFile.
This allows constructing a Mangler with just a TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp4
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp14
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 61f67e9..37df936 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -164,7 +164,7 @@ bool AsmPrinter::doInitialization(Module &M) {
OutStreamer.InitStreamer();
- Mang = new Mangler(OutContext, &TM);
+ Mang = new Mangler(&TM);
// Allow the target to emit any magic that it wants at the start of the file.
EmitStartOfAsmFile(M);
@@ -264,7 +264,7 @@ void AsmPrinter::EmitLinkage(unsigned L, MCSymbol *GVSym) const {
}
MCSymbol *AsmPrinter::getSymbol(const GlobalValue *GV) const {
- return Mang->getSymbol(GV);
+ return getObjFileLowering().getSymbol(*Mang, GV);
}
/// EmitGlobalVariable - Emit the specified global variable to the .s file.
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 085e8f4..5d16f04 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -52,10 +52,10 @@ TargetLoweringObjectFileELF::getCFIPersonalitySymbol(const GlobalValue *GV,
default:
report_fatal_error("We do not support this DWARF encoding yet!");
case dwarf::DW_EH_PE_absptr:
- return Mang->getSymbol(GV);
+ return getSymbol(*Mang, GV);
case dwarf::DW_EH_PE_pcrel: {
return getContext().GetOrCreateSymbol(StringRef("DW.ref.") +
- Mang->getSymbol(GV)->getName());
+ getSymbol(*Mang, GV)->getName());
}
}
}
@@ -104,7 +104,7 @@ getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
MCSymbol *SSym = getContext().GetOrCreateSymbol(Name.str());
MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = Mang->getSymbol(GV);
+ MCSymbol *Sym = getSymbol(*Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
@@ -252,7 +252,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Prefix = getSectionPrefixForGlobal(Kind);
SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
- MCSymbol *Sym = Mang->getSymbol(GV);
+ MCSymbol *Sym = getSymbol(*Mang, GV);
Name.append(Sym->getName().begin(), Sym->getName().end());
StringRef Group = "";
unsigned Flags = getELFSectionFlags(Kind);
@@ -613,7 +613,7 @@ shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler *Mang) const {
// FIXME: ObjC metadata is currently emitted as internal symbols that have
// \1L and \0l prefixes on them. Fix them to be Private/LinkerPrivate and
// this horrible hack can go away.
- MCSymbol *Sym = Mang->getSymbol(GV);
+ MCSymbol *Sym = getSymbol(*Mang, GV);
if (Sym->getName()[0] == 'L' || Sym->getName()[0] == 'l')
return false;
}
@@ -642,7 +642,7 @@ getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
GV->hasHiddenVisibility() ? MachOMMI.getHiddenGVStubEntry(SSym) :
MachOMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = Mang->getSymbol(GV);
+ MCSymbol *Sym = getSymbol(*Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
@@ -671,7 +671,7 @@ getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
MCSymbol *SSym = getContext().GetOrCreateSymbol(Name.str());
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = Mang->getSymbol(GV);
+ MCSymbol *Sym = getSymbol(*Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}