aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips/MCTargetDesc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-12-21 17:00:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-12-21 17:00:36 +0000
commitdc9a8a378daf432d8dcfc178507afe149706f9a6 (patch)
tree85cd35484f314f9f704e492d939bedc02958f3ce /lib/Target/Mips/MCTargetDesc
parentd4304031cb465ca85e2bebb352b7cde5a92a1c39 (diff)
downloadexternal_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/Mips/MCTargetDesc')
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp b/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
index 60ff4fe..699148b 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
+++ b/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
@@ -72,9 +72,9 @@ namespace {
class MipsELFObjectWriter : public MCELFObjectTargetWriter {
public:
- MipsELFObjectWriter(bool is64Bit, Triple::OSType OSType, uint16_t EMachine,
+ MipsELFObjectWriter(bool is64Bit, uint8_t OSABI, uint16_t EMachine,
bool HasRelocationAddend)
- : MCELFObjectTargetWriter(is64Bit, OSType, EMachine,
+ : MCELFObjectTargetWriter(is64Bit, OSABI, EMachine,
HasRelocationAddend) {}
};
@@ -197,10 +197,10 @@ public:
class MipsEB_AsmBackend : public MipsAsmBackend {
public:
- Triple::OSType OSType;
+ uint8_t OSABI;
- MipsEB_AsmBackend(const Target &T, Triple::OSType _OSType)
- : MipsAsmBackend(T), OSType(_OSType) {}
+ MipsEB_AsmBackend(const Target &T, uint8_t _OSABI)
+ : MipsAsmBackend(T), OSABI(_OSABI) {}
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return createELFObjectWriter(createELFObjectTargetWriter(),
@@ -208,16 +208,16 @@ public:
}
MCELFObjectTargetWriter *createELFObjectTargetWriter() const {
- return new MipsELFObjectWriter(false, OSType, ELF::EM_MIPS, false);
+ return new MipsELFObjectWriter(false, OSABI, ELF::EM_MIPS, false);
}
};
class MipsEL_AsmBackend : public MipsAsmBackend {
public:
- Triple::OSType OSType;
+ uint8_t OSABI;
- MipsEL_AsmBackend(const Target &T, Triple::OSType _OSType)
- : MipsAsmBackend(T), OSType(_OSType) {}
+ MipsEL_AsmBackend(const Target &T, uint8_t _OSABI)
+ : MipsAsmBackend(T), OSABI(_OSABI) {}
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return createELFObjectWriter(createELFObjectTargetWriter(),
@@ -225,7 +225,7 @@ public:
}
MCELFObjectTargetWriter *createELFObjectTargetWriter() const {
- return new MipsELFObjectWriter(false, OSType, ELF::EM_MIPS, false);
+ return new MipsELFObjectWriter(false, OSABI, ELF::EM_MIPS, false);
}
};
} // namespace
@@ -235,5 +235,6 @@ MCAsmBackend *llvm::createMipsAsmBackend(const Target &T, StringRef TT) {
// just return little endian for now
//
- return new MipsEL_AsmBackend(T, Triple(TT).getOS());
+ uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(Triple(TT).getOS());
+ return new MipsEL_AsmBackend(T, OSABI);
}