diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-12-21 17:00:36 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-12-21 17:00:36 +0000 |
commit | dc9a8a378daf432d8dcfc178507afe149706f9a6 (patch) | |
tree | 85cd35484f314f9f704e492d939bedc02958f3ce /lib/Target/MBlaze | |
parent | d4304031cb465ca85e2bebb352b7cde5a92a1c39 (diff) | |
download | external_llvm-dc9a8a378daf432d8dcfc178507afe149706f9a6.zip external_llvm-dc9a8a378daf432d8dcfc178507afe149706f9a6.tar.gz external_llvm-dc9a8a378daf432d8dcfc178507afe149706f9a6.tar.bz2 |
Reduce the exposure of Triple::OSType in the ELF object writer. This will
avoid including ADT/Triple.h in many places when the target specific bits are
moved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MBlaze')
-rw-r--r-- | lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp b/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp index d5acbe9..c0c2106 100644 --- a/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp +++ b/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp @@ -41,8 +41,8 @@ static unsigned getFixupKindSize(unsigned Kind) { namespace { class MBlazeELFObjectWriter : public MCELFObjectTargetWriter { public: - MBlazeELFObjectWriter(Triple::OSType OSType) - : MCELFObjectTargetWriter(/*is64Bit*/ false, OSType, ELF::EM_MBLAZE, + MBlazeELFObjectWriter(uint8_t OSABI) + : MCELFObjectTargetWriter(/*is64Bit*/ false, OSABI, ELF::EM_MBLAZE, /*HasRelocationAddend*/ true) {} }; @@ -123,15 +123,15 @@ bool MBlazeAsmBackend::WriteNopData(uint64_t Count, MCObjectWriter *OW) const { namespace { class ELFMBlazeAsmBackend : public MBlazeAsmBackend { public: - Triple::OSType OSType; - ELFMBlazeAsmBackend(const Target &T, Triple::OSType _OSType) - : MBlazeAsmBackend(T), OSType(_OSType) { } + uint8_t OSABI; + ELFMBlazeAsmBackend(const Target &T, uint8_t _OSABI) + : MBlazeAsmBackend(T), OSABI(_OSABI) { } void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const; MCObjectWriter *createObjectWriter(raw_ostream &OS) const { - return createELFObjectWriter(new MBlazeELFObjectWriter(OSType), OS, + return createELFObjectWriter(new MBlazeELFObjectWriter(OSABI), OS, /*IsLittleEndian*/ false); } }; @@ -172,5 +172,6 @@ MCAsmBackend *llvm::createMBlazeAsmBackend(const Target &T, StringRef TT) { if (TheTriple.isOSWindows()) assert(0 && "Windows not supported on MBlaze"); - return new ELFMBlazeAsmBackend(T, TheTriple.getOS()); + uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TheTriple.getOS()); + return new ELFMBlazeAsmBackend(T, OSABI); } |