diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-16 00:14:15 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-16 00:14:15 +0000 |
commit | 6623730296fbe6d639058195772566ffa10e9ad2 (patch) | |
tree | 1652b6b0fef59f5d56175922518321efd884204b | |
parent | 490c7d97737ea7719efcea7321d3cfa3984b0027 (diff) | |
download | external_llvm-6623730296fbe6d639058195772566ffa10e9ad2.zip external_llvm-6623730296fbe6d639058195772566ffa10e9ad2.tar.gz external_llvm-6623730296fbe6d639058195772566ffa10e9ad2.tar.bz2 |
Improve r172577 by using the correct type when declaring constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172580 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Object/ELF.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index f22ee71..417a0f1 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -37,11 +37,9 @@ using support::endianness; template<endianness target_endianness, std::size_t max_alignment, bool is64Bits> struct ELFType { - enum { - TargetEndianness = target_endianness, - MaxAlignment = max_alignment, - Is64Bits = is64Bits - }; + static const endianness TargetEndianness = target_endianness; + static const std::size_t MaxAlignment = max_alignment; + static const bool Is64Bits = is64Bits; }; template<typename T, int max_align> @@ -792,8 +790,7 @@ public: // Methods for type inquiry through isa, cast, and dyn_cast bool isDyldType() const { return isDyldELFObject; } static inline bool classof(const Binary *v) { - return v->getType() == getELFType(static_cast<int>(ELFT::TargetEndianness) - == static_cast<int>(support::little), + return v->getType() == getELFType(ELFT::TargetEndianness == support::little, ELFT::Is64Bits); } }; @@ -2380,8 +2377,7 @@ unsigned ELFObjectFile<ELFT>::getArch() const { case ELF::EM_HEXAGON: return Triple::hexagon; case ELF::EM_MIPS: - return (static_cast<int>(ELFT::TargetEndianness) - == static_cast<int>(support::little)) ? + return (ELFT::TargetEndianness == support::little) ? Triple::mipsel : Triple::mips; case ELF::EM_PPC64: return Triple::ppc64; |