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 /include | |
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 'include')
-rw-r--r-- | include/llvm/MC/MCELFObjectWriter.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/llvm/MC/MCELFObjectWriter.h b/include/llvm/MC/MCELFObjectWriter.h index 41a9fbc..1543ede 100644 --- a/include/llvm/MC/MCELFObjectWriter.h +++ b/include/llvm/MC/MCELFObjectWriter.h @@ -12,23 +12,37 @@ #include "llvm/MC/MCObjectWriter.h" #include "llvm/Support/DataTypes.h" +#include "llvm/Support/ELF.h" namespace llvm { class MCELFObjectTargetWriter { - const Triple::OSType OSType; + const uint8_t OSABI; const uint16_t EMachine; const unsigned HasRelocationAddend : 1; const unsigned Is64Bit : 1; + protected: - MCELFObjectTargetWriter(bool Is64Bit_, Triple::OSType OSType_, + + MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_, uint16_t EMachine_, bool HasRelocationAddend_); public: + static uint8_t getOSABI(Triple::OSType OSType) { + switch (OSType) { + case Triple::FreeBSD: + return ELF::ELFOSABI_FREEBSD; + case Triple::Linux: + return ELF::ELFOSABI_LINUX; + default: + return ELF::ELFOSABI_NONE; + } + } + virtual ~MCELFObjectTargetWriter(); /// @name Accessors /// @{ - Triple::OSType getOSType() { return OSType; } + uint8_t getOSABI() { return OSABI; } uint16_t getEMachine() { return EMachine; } bool hasRelocationAddend() { return HasRelocationAddend; } bool is64Bit() const { return Is64Bit; } |