[llvm] r227692 - X86: silence a GCC warning

Saleem Abdulrasool compnerd at compnerd.org
Sat Jan 31 09:56:11 PST 2015


Author: compnerd
Date: Sat Jan 31 11:56:11 2015
New Revision: 227692

URL: http://llvm.org/viewvc/llvm-project?rev=227692&view=rev
Log:
X86: silence a GCC warning

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.

Modified:
    llvm/trunk/lib/Target/X86/Utils/X86ShuffleDecode.cpp

Modified: llvm/trunk/lib/Target/X86/Utils/X86ShuffleDecode.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Utils/X86ShuffleDecode.cpp?rev=227692&r1=227691&r2=227692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Utils/X86ShuffleDecode.cpp (original)
+++ llvm/trunk/lib/Target/X86/Utils/X86ShuffleDecode.cpp Sat Jan 31 11:56:11 2015
@@ -429,6 +429,6 @@ void DecodeScalarMoveMask(MVT VT, bool I
   unsigned NumElts = VT.getVectorNumElements();
   Mask.push_back(NumElts);
   for (unsigned i = 1; i < NumElts; i++)
-    Mask.push_back(IsLoad ? SM_SentinelZero : i);
+    Mask.push_back(IsLoad ? static_cast<int>(SM_SentinelZero) : i);
 }
 } // llvm namespace





More information about the llvm-commits mailing list