diff options
Diffstat (limited to 'llvm/lib/Target/X86')
| -rw-r--r-- | llvm/lib/Target/X86/X86MCInstLower.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetObjectFile.cpp | 26 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetObjectFile.h | 12 |
3 files changed, 22 insertions, 18 deletions
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index 6f88cf10595..3dabbd72ede 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -98,7 +98,7 @@ GetSymbolFromOperand(const MachineOperand &MO) const { if (MO.isGlobal()) { const GlobalValue *GV = MO.getGlobal(); - getMang()->getNameWithPrefix(Name, GV); + AsmPrinter.getNameWithPrefix(Name, GV); } else if (MO.isSymbol()) { getMang()->getNameWithPrefix(Name, MO.getSymbolName()); } else if (MO.isMBB()) { diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.cpp b/llvm/lib/Target/X86/X86TargetObjectFile.cpp index c5ba3ecd91f..95fccba48ac 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.cpp +++ b/llvm/lib/Target/X86/X86TargetObjectFile.cpp @@ -14,18 +14,20 @@ #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSectionELF.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Target/TargetLowering.h" using namespace llvm; using namespace dwarf; const MCExpr *X86_64MachoTargetObjectFile::getTTypeGlobalReference( const GlobalValue *GV, unsigned Encoding, Mangler &Mang, - MachineModuleInfo *MMI, MCStreamer &Streamer) const { + const TargetMachine &TM, MachineModuleInfo *MMI, + MCStreamer &Streamer) const { // 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 = getSymbol(GV, Mang); + const MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang); const MCExpr *Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOTPCREL, getContext()); const MCExpr *Four = MCConstantExpr::Create(4, getContext()); @@ -33,13 +35,13 @@ const MCExpr *X86_64MachoTargetObjectFile::getTTypeGlobalReference( } return TargetLoweringObjectFileMachO::getTTypeGlobalReference( - GV, Encoding, Mang, MMI, Streamer); + GV, Encoding, Mang, TM, MMI, Streamer); } -MCSymbol *X86_64MachoTargetObjectFile:: -getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, - MachineModuleInfo *MMI) const { - return getSymbol(GV, Mang); +MCSymbol *X86_64MachoTargetObjectFile::getCFIPersonalitySymbol( + const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM, + MachineModuleInfo *MMI) const { + return TM.getTargetLowering()->getSymbol(GV, Mang); } void @@ -54,9 +56,8 @@ X86LinuxTargetObjectFile::getDebugThreadLocalSymbol( return MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_DTPOFF, getContext()); } -const MCExpr * -X86WindowsTargetObjectFile::getExecutableRelativeSymbol(const ConstantExpr *CE, - Mangler &Mang) const { +const MCExpr *X86WindowsTargetObjectFile::getExecutableRelativeSymbol( + const ConstantExpr *CE, Mangler &Mang, const TargetMachine &TM) const { // We are looking for the difference of two symbols, need a subtraction // operation. const SubOperator *Sub = dyn_cast<SubOperator>(CE); @@ -101,6 +102,7 @@ X86WindowsTargetObjectFile::getExecutableRelativeSymbol(const ConstantExpr *CE, if (GVLHS->isThreadLocal()) return 0; - return MCSymbolRefExpr::Create( - getSymbol(GVLHS, Mang), MCSymbolRefExpr::VK_COFF_IMGREL32, getContext()); + return MCSymbolRefExpr::Create(TM.getTargetLowering()->getSymbol(GVLHS, Mang), + MCSymbolRefExpr::VK_COFF_IMGREL32, + getContext()); } diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.h b/llvm/lib/Target/X86/X86TargetObjectFile.h index 45739475f8d..22f3e572d9c 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.h +++ b/llvm/lib/Target/X86/X86TargetObjectFile.h @@ -20,15 +20,16 @@ namespace llvm { /// x86-64. class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO { public: - const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, - unsigned Encoding, Mangler &Mang, - MachineModuleInfo *MMI, - MCStreamer &Streamer) const + const MCExpr * + getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, + Mangler &Mang, const TargetMachine &TM, + MachineModuleInfo *MMI, MCStreamer &Streamer) const LLVM_OVERRIDE; // getCFIPersonalitySymbol - The symbol that gets passed to // .cfi_personality. MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, + const TargetMachine &TM, MachineModuleInfo *MMI) const LLVM_OVERRIDE; }; @@ -46,7 +47,8 @@ namespace llvm { /// \brief This implementation is used for Windows targets on x86 and x86-64. class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF { const MCExpr *getExecutableRelativeSymbol(const ConstantExpr *CE, - Mangler &Mang) const + Mangler &Mang, + const TargetMachine &TM) const LLVM_OVERRIDE; }; |

