X86: silence a GCC warning
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 31 Jan 2015 17:56:11 +0000 (17:56 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 31 Jan 2015 17:56:11 +0000 (17:56 +0000)
GCC 4.9 gives the following warning:
  warning: enumeral and non-enumeral type in conditional expression
Cast the enumeral value to an integer within the ternary operation.  NFC.

llvm-svn: 227692

llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp

index e71fda5..a7101e4 100644 (file)
@@ -429,6 +429,6 @@ void DecodeScalarMoveMask(MVT VT, bool IsLoad, SmallVectorImpl<int> &Mask) {
   unsigned NumElts = VT.getVectorNumElements();\r
   Mask.push_back(NumElts);\r
   for (unsigned i = 1; i < NumElts; i++)\r
-    Mask.push_back(IsLoad ? SM_SentinelZero : i);\r
+    Mask.push_back(IsLoad ? static_cast<int>(SM_SentinelZero) : i);\r
 }\r
 } // llvm namespace\r