diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-08-25 19:37:26 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-08-25 19:37:26 +0000 |
commit | 07b52b367f2c89e21c8c8d8430760575a81adfe7 (patch) | |
tree | ea3bc16bfa312439d4aae4023ee846d82d83c22b /lib/Target/CBackend/Writer.cpp | |
parent | 8a702e8e1bc996374197190281a6d578ab006dd9 (diff) |
Previous checkin broke printf(%a) support for fp constants-- re-fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/Writer.cpp')
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 960abd9caf..b8208d4a4c 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -590,7 +590,15 @@ void CWriter::printConstant(Constant *CPV) { Out << "LLVM_INF" << (FPC->getType() == Type::FloatTy ? "F" : "") << " /*inf*/ "; } else { - std::string Num = ftostr(FPC->getValue()); + std::string Num; +#if HAVE_PRINTF_A + // Print out the constant as a floating point number. + char Buffer[100]; + sprintf(Buffer, "%a", FPC->getValue()); + Num = Buffer; +#else + Num = ftostr(FPC->getValue()); +#endif Out << Num; } } |