[llvm] r237683 - Fix Visual C++ errors C2784, C2780, C2782 after r237678.

Paweł Bylica chfast at gmail.com
Tue May 19 04:46:30 PDT 2015


I wanted to fix some MSVC warnings in LLVM headers, but it caused many
problems like the one you fixed. I do not plan to put it back.

It requires a much more thinking about. And probably some global policy
about headers C++ coding standards...

On Tue, May 19, 2015 at 1:32 PM Yaron Keren <yaron.keren at gmail.com> wrote:

> Oops, crossed e-mails.
> Do you plan to bring this change back sometime? if so, at least this issue
> is fixed for you.
>
> If not I should revert my change as well, the cast is harmless but useless.
>
>
> 2015-05-19 14:27 GMT+03:00 Paweł Bylica <chfast at gmail.com>:
>
>> I reverted that change. Sorry about causing problems.
>>
>
> On Tue, May 19, 2015 at 1:24 PM Yaron Keren <yaron.keren at gmail.com> wrote:
>
>> Author: yrnkrn
>> Date: Tue May 19 06:18:10 2015
>> New Revision: 237683
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=237683&view=rev
>> Log:
>> Fix Visual C++ errors C2784, C2780, C2782 after r237678.
>> It does not like std::min(unsigned, uint32_t).
>>
>>
>> Modified:
>>     llvm/trunk/lib/IR/ConstantFold.cpp
>>
>> Modified: llvm/trunk/lib/IR/ConstantFold.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantFold.cpp?rev=237683&r1=237682&r2=237683&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/IR/ConstantFold.cpp (original)
>> +++ llvm/trunk/lib/IR/ConstantFold.cpp Tue May 19 06:18:10 2015
>> @@ -1057,7 +1057,8 @@ Constant *llvm::ConstantFoldBinaryInstru
>>
>>            if (GVAlign > 1) {
>>              unsigned DstWidth = CI2->getType()->getBitWidth();
>> -            unsigned SrcWidth = std::min(DstWidth, Log2_32(GVAlign));
>> +            unsigned SrcWidth =
>> +                std::min(DstWidth,
>> static_cast<unsigned>(Log2_32(GVAlign)));
>>              APInt BitsNotSet(APInt::getLowBitsSet(DstWidth, SrcWidth));
>>
>>              // If checking bits we know are clear, return zero.
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150519/7da852a0/attachment.html>


More information about the llvm-commits mailing list