[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jul 25 15:36:46 PDT 2004



Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.191 -> 1.192

---
Log message:

Temporarily disable this code, as it is emitting LLVM_NAN("nan") which results in a call to the
glibc 'nan' function because the initializer is not a string.  This breaks when used in a global
initializer.  Try compiling this testcase for example:

%X = global float <some nan value>




---
Diffs of the changes:  (+2 -2)

Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.191 llvm/lib/Target/CBackend/Writer.cpp:1.192
--- llvm/lib/Target/CBackend/Writer.cpp:1.191	Tue Jul 20 22:15:26 2004
+++ llvm/lib/Target/CBackend/Writer.cpp	Sun Jul 25 17:36:35 2004
@@ -570,9 +570,9 @@
       if (IsNAN(FPC->getValue())) {
         // The value is NaN
         if (FPC->getType() == Type::FloatTy)
-          Out << "LLVM_NANF(\"" << Num << "\") /*nan*/ ";
+          Out << "LLVM_NANF(\"0\") /*nan*/ ";
         else
-          Out << "LLVM_NAN(\"" << Num << "\") /*nan*/ ";
+          Out << "LLVM_NAN(\"0\") /*nan*/ ";
       } else if (IsInf(FPC->getValue())) {
         // The value is Inf
         if (FPC->getValue() < 0) Out << "-";





More information about the llvm-commits mailing list