ARM64: add an explicit cast to silence a silly warning
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 10 Apr 2014 02:48:10 +0000 (02:48 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 10 Apr 2014 02:48:10 +0000 (02:48 +0000)
GCC 4.8 complains with:
  warning: enumeral and non-enumeral type in conditional expression

Although this is silly and harmless in this case, add an explicit cast to
silence the warning.

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

lib/Target/ARM64/ARM64TargetTransformInfo.cpp

index 5323b8965f474dee81828a86d56b15a64f2cd306..f12d1be81a16c9855e96cf110f02e5d5f69fee7d 100644 (file)
@@ -227,7 +227,8 @@ unsigned ARM64TTI::getIntImmCost(unsigned Opcode, unsigned Idx,
   if (Idx == ImmIdx) {
     unsigned NumConstants = (BitSize + 63) / 64;
     unsigned Cost = ARM64TTI::getIntImmCost(Imm, Ty);
-    return (Cost <= NumConstants * TCC_Basic) ? TCC_Free : Cost;
+    return (Cost <= NumConstants * TCC_Basic)
+      ? static_cast<unsigned>(TCC_Free) : Cost;
   }
   return ARM64TTI::getIntImmCost(Imm, Ty);
 }
@@ -252,7 +253,8 @@ unsigned ARM64TTI::getIntImmCost(Intrinsic::ID IID, unsigned Idx,
     if (Idx == 1) {
       unsigned NumConstants = (BitSize + 63) / 64;
       unsigned Cost = ARM64TTI::getIntImmCost(Imm, Ty);
-      return (Cost <= NumConstants * TCC_Basic) ? TCC_Free : Cost;
+      return (Cost <= NumConstants * TCC_Basic)
+        ? static_cast<unsigned>(TCC_Free) : Cost;
     }
     break;
   case Intrinsic::experimental_stackmap: