[LLVMdev] Plea for help

Alkis Evlogimenos alkis at cs.uiuc.edu
Thu May 6 09:43:02 PDT 2004


On Thu, May 06, 2004 at 04:06:27PM +0200, Finn S Andersen wrote:
> Chris Lattner wrote:
> 
> >I think that we should switch to C constants in this case.  Can you try
> >#include <math.h> and use HUGE_VAL instead?
> >
> It works:
> 
> [finna at coplin11 ~/test]$ cat tst.cpp
> #include <limits>
> #include <iostream>
> #include <math.h>
> int main() {
>  std::cerr << std::numeric_limits<float>::infinity() << "\n";
>  std::cerr << HUGE_VAL << "\n";
> }
> [finna at coplin11 ~/test]$ g++ tst.cpp
> [finna at coplin11 ~/test]$ ./a.out
> 0
> inf
> [finna at coplin11 ~/test]$
> 
> But making the consequential changes in LLVM seems trickier.
> Do you plan to correct it in CVS, or is there a path I can follow
> to fix it myself on my own installation ?

The easy way to do it in your area is to replace all occurences of 
std::numeric_limits<float>::infinity() with HUGE_VAL. The only two files 
that use std::numeric_limits<float>::infinity() are 
lib/CodeGen/RegAllocLinearScan.cpp and lib/CodeGen/LiveIntervals.cpp.

As for CVS, I am not sure this should be fixed because there is 
really no LLVM bug here :-)

-- 

Alkis



More information about the llvm-dev mailing list