aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-25 22:36:35 +0000
committerChris Lattner <sabre@nondot.org>2004-07-25 22:36:35 +0000
commita9d790c831de8f5dd96b689e337c35153f78a7c7 (patch)
treeba4ea2a89a865e69511ac608d08eb36721447aee
parentf847432f77d0cd59e172b727fbd890c60d5ad5fd (diff)
downloadexternal_llvm-a9d790c831de8f5dd96b689e337c35153f78a7c7.zip
external_llvm-a9d790c831de8f5dd96b689e337c35153f78a7c7.tar.gz
external_llvm-a9d790c831de8f5dd96b689e337c35153f78a7c7.tar.bz2
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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15223 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
-rw-r--r--lib/Target/CBackend/Writer.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 926f72d..65a110e 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -570,9 +570,9 @@ void CWriter::printConstant(Constant *CPV) {
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 << "-";
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 926f72d..65a110e 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -570,9 +570,9 @@ void CWriter::printConstant(Constant *CPV) {
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 << "-";