[llvm] r254679 - IR: Update a comment and a bool that've been out of date since 2012

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 23:29:19 PST 2015


On Thursday, December 3, 2015, David Blaikie <dblaikie at gmail.com> wrote:

> Perhaps this should have some test coverage so it doesn't regress like
> this again/in other fun ways?
>

Not really sure what could be tested for this change. `isHalf` was always
false since this is in an `if (isFloat || isDouble)` block...


> On Thu, Dec 3, 2015 at 5:14 PM, Justin Bogner via llvm-commits <
> llvm-commits at lists.llvm.org
> <javascript:_e(%7B%7D,'cvml','llvm-commits at lists.llvm.org');>> wrote:
>
>> Author: bogner
>> Date: Thu Dec  3 19:14:24 2015
>> New Revision: 254679
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=254679&view=rev
>> Log:
>> IR: Update a comment and a bool that've been out of date since 2012
>>
>> It became impossible to get here with a half in r157393, over 3 years
>> ago.
>>
>> Modified:
>>     llvm/trunk/lib/IR/AsmWriter.cpp
>>
>> Modified: llvm/trunk/lib/IR/AsmWriter.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=254679&r1=254678&r2=254679&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/IR/AsmWriter.cpp (original)
>> +++ llvm/trunk/lib/IR/AsmWriter.cpp Thu Dec  3 19:14:24 2015
>> @@ -1108,11 +1108,10 @@ static void WriteConstantInternal(raw_os
>>        // the value back and get the same value.
>>        //
>>        bool ignored;
>> -      bool isHalf =
>> &CFP->getValueAPF().getSemantics()==&APFloat::IEEEhalf;
>>        bool isDouble =
>> &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble;
>>        bool isInf = CFP->getValueAPF().isInfinity();
>>        bool isNaN = CFP->getValueAPF().isNaN();
>> -      if (!isHalf && !isInf && !isNaN) {
>> +      if (!isInf && !isNaN) {
>>          double Val = isDouble ? CFP->getValueAPF().convertToDouble() :
>>                                  CFP->getValueAPF().convertToFloat();
>>          SmallString<128> StrVal;
>> @@ -1140,7 +1139,7 @@ static void WriteConstantInternal(raw_os
>>                      "assuming that double is 64 bits!");
>>        char Buffer[40];
>>        APFloat apf = CFP->getValueAPF();
>> -      // Halves and floats are represented in ASCII IR as double,
>> convert.
>> +      // Floats are represented in ASCII IR as double, convert.
>>        if (!isDouble)
>>          apf.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven,
>>                            &ignored);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> <javascript:_e(%7B%7D,'cvml','llvm-commits at lists.llvm.org');>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151203/753a71e8/attachment.html>


More information about the llvm-commits mailing list