[llvm-commits] [llvm] r172577 - /llvm/trunk/include/llvm/Object/ELF.h
David Greene
greened at obbligato.org
Tue Jan 15 15:46:59 PST 2013
Author: greened
Date: Tue Jan 15 17:46:58 2013
New Revision: 172577
URL: http://llvm.org/viewvc/llvm-project?rev=172577&view=rev
Log:
Avoid Enum Compare Warnings
Avoid a compiler warning about comparing disjoint enums but casting
them to int first.
Modified:
llvm/trunk/include/llvm/Object/ELF.h
Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=172577&r1=172576&r2=172577&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Tue Jan 15 17:46:58 2013
@@ -792,7 +792,8 @@
// 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 @@
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;
More information about the llvm-commits
mailing list