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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227692 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/Utils/X86ShuffleDecode.cpp

index e71fda551a1cf0b61b7d42cbdb22a5954570423f..a7101e4febbb0cfc2e78511a39935a8277d6448c 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