summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2013-01-15 23:46:58 +0000
committerDavid Greene <greened@obbligato.org>2013-01-15 23:46:58 +0000
commitaf50dda4102114b23ac7d8c2db4703f22e02f02c (patch)
tree6cf98ee952d47a9627ceeaad03ca39fbca74d9bf
parent83d585383345b84ae4a9590e97135f95ae39406b (diff)
downloadllvm-af50dda4102114b23ac7d8c2db4703f22e02f02c.tar.gz
llvm-af50dda4102114b23ac7d8c2db4703f22e02f02c.tar.bz2
llvm-af50dda4102114b23ac7d8c2db4703f22e02f02c.tar.xz
Avoid Enum Compare Warnings
Avoid a compiler warning about comparing disjoint enums but casting them to int first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172577 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Object/ELF.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h
index c47b9cdf32..f22ee71ca4 100644
--- a/include/llvm/Object/ELF.h
+++ b/include/llvm/Object/ELF.h
@@ -792,7 +792,8 @@ 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(ELFT::TargetEndianness == support::little,
+ return v->getType() == getELFType(static_cast<int>(ELFT::TargetEndianness)
+ == static_cast<int>(support::little),
ELFT::Is64Bits);
}
};
@@ -2379,7 +2380,8 @@ unsigned ELFObjectFile<ELFT>::getArch() const {
case ELF::EM_HEXAGON:
return Triple::hexagon;
case ELF::EM_MIPS:
- return (ELFT::TargetEndianness == support::little) ?
+ return (static_cast<int>(ELFT::TargetEndianness)
+ == static_cast<int>(support::little)) ?
Triple::mipsel : Triple::mips;
case ELF::EM_PPC64:
return Triple::ppc64;