[llvm] r205949 - ARM64: add an explicit cast to silence a silly warning
Saleem Abdulrasool
compnerd at compnerd.org
Sat Apr 12 10:37:39 PDT 2014
On Thu, Apr 10, 2014 at 9:32 AM, David Blaikie <dblaikie at gmail.com> wrote:
> 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?
Im not convinced that the warning is bad in all cases. It could identify
places where you return a value that is invalid in the associated
enumeration. As such, I think seeing how often it gets triggered and
whether it is always invalid might be a good idea.
> >
> > 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
>
--
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140412/1c680246/attachment.html>
More information about the llvm-commits
mailing list