move getNameWithPrefix and getSymbol to TargetMachine.

TargetLoweringBase is implemented in CodeGen, so before this patch we had
a dependency fom Target to CodeGen. This would show up as a link failure of
llvm-stress when building with -DBUILD_SHARED_LIBS=ON.

This fixes pr18900.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-02-19 20:30:41 +00:00
parent 737c9f6005
commit b4aaffffd3
14 changed files with 60 additions and 56 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ const MCExpr *X86_64MachoTargetObjectFile::getTTypeGlobalReference(
// On Darwin/X86-64, we can reference dwarf symbols with foo@GOTPCREL+4, which
// is an indirect pc-relative reference.
if (Encoding & (DW_EH_PE_indirect | DW_EH_PE_pcrel)) {
const MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
const MCSymbol *Sym = TM.getSymbol(GV, Mang);
const MCExpr *Res =
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOTPCREL, getContext());
const MCExpr *Four = MCConstantExpr::Create(4, getContext());
@@ -41,7 +41,7 @@ const MCExpr *X86_64MachoTargetObjectFile::getTTypeGlobalReference(
MCSymbol *X86_64MachoTargetObjectFile::getCFIPersonalitySymbol(
const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM,
MachineModuleInfo *MMI) const {
return TM.getTargetLowering()->getSymbol(GV, Mang);
return TM.getSymbol(GV, Mang);
}
void
@@ -102,7 +102,7 @@ const MCExpr *X86WindowsTargetObjectFile::getExecutableRelativeSymbol(
if (GVLHS->isThreadLocal())
return 0;
return MCSymbolRefExpr::Create(TM.getTargetLowering()->getSymbol(GVLHS, Mang),
return MCSymbolRefExpr::Create(TM.getSymbol(GVLHS, Mang),
MCSymbolRefExpr::VK_COFF_IMGREL32,
getContext());
}