]> granicus.if.org Git - llvm/commitdiff
Fix an enumeral mismatch warning.
authorHaojian Wu <hokein@google.com>
Mon, 13 Jun 2016 09:03:45 +0000 (09:03 +0000)
committerHaojian Wu <hokein@google.com>
Mon, 13 Jun 2016 09:03:45 +0000 (09:03 +0000)
Summary:
The "-Werror=enum-compare" shows that the statement is using two different enums:

enumeral mismatch in conditional expression: 'llvm::X86ISD::NodeType' vs 'llvm::ISD::NodeType'

A follow-up fix on D21235.

Reviewers: klimek

Subscribers: spatel, cfe-commits

Differential Revision: http://reviews.llvm.org/D21278

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

lib/Target/X86/X86ISelLowering.cpp

index e06432f39dca525e5f9aa25dbc20dd61be90b4ee..69cf0d269a53768b9eefbcc98414dabefc26d4da 100644 (file)
@@ -15185,12 +15185,14 @@ static SDValue LowerVSETCC(SDValue Op, const X86Subtarget &Subtarget,
       if (SetCCOpcode == ISD::SETUEQ) {
         CC0 = 3; // UNORD
         CC1 = 0; // EQ
-        CombineOpc = Opc == X86ISD::CMPP ? X86ISD::FOR : ISD::OR;
+        CombineOpc = Opc == X86ISD::CMPP ? static_cast<unsigned>(X86ISD::FOR) :
+                                           static_cast<unsigned>(ISD::OR);
       } else {
         assert(SetCCOpcode == ISD::SETONE);
         CC0 = 7; // ORD
         CC1 = 4; // NEQ
-        CombineOpc = Opc == X86ISD::CMPP ? X86ISD::FAND : ISD::AND;
+        CombineOpc = Opc == X86ISD::CMPP ? static_cast<unsigned>(X86ISD::FAND) :
+                                           static_cast<unsigned>(ISD::AND);
       }
 
       SDValue Cmp0 = DAG.getNode(Opc, dl, VT, Op0, Op1,