summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-05 21:49:27 +0000
committerChris Lattner <sabre@nondot.org>2008-10-05 21:49:27 +0000
commitac7ed9a71a63aaa4f86f5e60e54f4a688bb49a44 (patch)
tree5fec39d08c2413e341f16b5953c7b5561a03df13 /clang/lib/Lex/Preprocessor.cpp
parentc34a35d56f7b4c72c6fb38f040d455170098d017 (diff)
downloadbcm5719-llvm-ac7ed9a71a63aaa4f86f5e60e54f4a688bb49a44.tar.gz
bcm5719-llvm-ac7ed9a71a63aaa4f86f5e60e54f4a688bb49a44.zip
move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ into
target indep code. llvm-svn: 57139
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 0c1accd6c27..6c5daae13bf 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -612,11 +612,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
Buf.push_back('\n');
}
+ char MacroBuf[60];
if (const char *Prefix = TI.getUserLabelPrefix()) {
- llvm::SmallString<20> TmpStr;
- TmpStr += "__USER_LABEL_PREFIX__=";
- TmpStr += Prefix;
- DefineBuiltinMacro(Buf, TmpStr.c_str());
+ sprintf(MacroBuf, "__USER_LABEL_PREFIX__=%s", Prefix);
+ DefineBuiltinMacro(Buf, MacroBuf);
}
// Build configuration options. FIXME: these should be controlled by
@@ -626,6 +625,13 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "__NO_INLINE__=1");
DefineBuiltinMacro(Buf, "__PIC__=1");
+ // Macros to control C99 numerics and <float.h>
+ DefineBuiltinMacro(Buf, "__FLT_EVAL_METHOD__=0");
+ DefineBuiltinMacro(Buf, "__FLT_RADIX__=2");
+ sprintf(MacroBuf, "__DECIMAL_DIG__=%d",
+ PickFP(&TI.getLongDoubleFormat(), -1/*FIXME*/, 17, 21, 33));
+ DefineBuiltinMacro(Buf, MacroBuf);
+
// Get other target #defines.
TI.getTargetDefines(Buf);
OpenPOWER on IntegriCloud