[llvm] r205949 - ARM64: add an explicit cast to silence a silly warning

David Blaikie dblaikie at gmail.com
Thu Apr 10 09:32:53 PDT 2014


On Wed, Apr 9, 2014 at 7:48 PM, Saleem Abdulrasool
<compnerd at compnerd.org> wrote:
> Author: compnerd
> Date: Wed Apr  9 21:48:10 2014
> New Revision: 205949
>
> URL: http://llvm.org/viewvc/llvm-project?rev=205949&view=rev
> Log:
> ARM64: add an explicit cast to silence a silly warning

If the warning is bad, can we just disable it for the project instead
of working around it?

>
> 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.
>
> Modified:
>     llvm/trunk/lib/Target/ARM64/ARM64TargetTransformInfo.cpp
>
> Modified: llvm/trunk/lib/Target/ARM64/ARM64TargetTransformInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64TargetTransformInfo.cpp?rev=205949&r1=205948&r2=205949&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM64/ARM64TargetTransformInfo.cpp (original)
> +++ llvm/trunk/lib/Target/ARM64/ARM64TargetTransformInfo.cpp Wed Apr  9 21:48:10 2014
> @@ -227,7 +227,8 @@ unsigned ARM64TTI::getIntImmCost(unsigne
>    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(Intrins
>      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:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list