[PATCH] Update to Cmake for VS 2013

Aaron Ballman aaron at aaronballman.com
Sun Nov 10 08:01:44 PST 2013


Ping with an explanation -- we have 16 instances of this warning in VS
2013 stemming from usage of HUGE_VALF in one header and three cpp
files.  So the choices we have for a clean build boil down to:

1) Blanket disable the warning -- I dislike this approach because it's
a useful warning in the vast majority of circumstances.
2) Use pragmas to spot-disable the warning -- I dislike this approach
because it needs to be disabled in several different places and is
messy.
3) Use llvm::huge_valf from this patch -- I dislike this approach
because it's replacing standard C functionality with something
non-standard which affects all backends.

Short of removing floating-point usage in the backend where HUGE_VALF
is a sentinel value (which may be a worthy idea for someday), I don't
see other alternatives, and I think that #3 is the least invasive.

~Aaron


On Mon, Nov 4, 2013 at 7:42 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> Ping?
>
> ~Aaron
>
> On Tue, Oct 29, 2013 at 7:27 PM, Reid Kleckner <rnk at google.com> wrote:
>> This seems like a better solution to me, but I'd like to hear from someone
>> who actually uses floating point values in LLVM-land if they think this is
>> OK.
>>
>>
>> On Tue, Oct 29, 2013 at 4:22 PM, Aaron Ballman <aaron at aaronballman.com>
>> wrote:
>>>
>>> Here's a patch with an attempt at llvm::huge_valf (I also included
>>> vald and vall for consistency).  It compiles cleanly with VS 2013,
>>> though it's impossible to tell how it affects tests since there is
>>> currently a miscompile that causes most of them to crash.
>>>
>>> ~Aaron
>>>
>>> On Tue, Oct 29, 2013 at 6:55 PM, Reid Kleckner <rnk at google.com> wrote:
>>> > On Tue, Oct 29, 2013 at 3:48 PM, Aaron Ballman <aaron at aaronballman.com>
>>> > wrote:
>>> >>
>>> >> There were about 15 warnings in several places from it.
>>> >>
>>> >> LiveIntervalAnalysis.cpp
>>> >> RegAllocGreedy.cpp in three places
>>> >> Spiller.cpp
>>> >> LiveInterval.h in two places
>>> >>
>>> >> If it was just in a single header file and getting tripped over on
>>> >> include, I would be okay with it, but it's a bit more widely dispersed
>>> >> than that.
>>> >>
>>> >> Alternatively, we could make an llvm::huge_valf that does suppress the
>>> >> warning and gets used in place of HUGE_VALF, if that's preferable?
>>> >
>>> >
>>> > llvm::huge_valf does sound preferable, as annoying as it is not to be
>>> > able
>>> > to use standard stuff from math.h.
>>
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: huge_valf.patch
Type: application/octet-stream
Size: 3954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131110/3a330838/attachment.obj>


More information about the llvm-commits mailing list