aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMelanie Blower <melanie.blower@intel.com>2021-07-28 10:50:14 -0400
committerMelanie Blower <melanie.blower@intel.com>2021-07-28 10:50:32 -0400
commit66ddac22e2a7f268e91c26d694112970dfa607ae (patch)
treee2ca6f4ad677bf55b3348441f5a0a36e24681c02 /clang/lib/Frontend/CompilerInvocation.cpp
parent23326b9f1723a398681def87c80e608fa94485f2 (diff)
downloadllvm-66ddac22e2a7f268e91c26d694112970dfa607ae.zip
llvm-66ddac22e2a7f268e91c26d694112970dfa607ae.tar.gz
llvm-66ddac22e2a7f268e91c26d694112970dfa607ae.tar.bz2
[CLANG][PATCH][FPEnv] Add support for option -ffp-eval-method and extend #pragma float_control similarly
The Intel compiler ICC supports the option "-fp-model=(source|double|extended)" which causes the compiler to use a wider type for intermediate floating point calculations. Also supported is a way to embed this effect in the source program with #pragma float_control(source|double|extended). This patch extends pragma float_control syntax, and also adds support for a new floating point option "-ffp-eval-method=(source|double|extended)". source: intermediate results use source precision double: intermediate results use double precision extended: intermediate results use extended precision Reviewed By: Aaron Ballman Differential Revision: https://reviews.llvm.org/D93769
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index d545e93..63436b7 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4242,8 +4242,13 @@ static bool ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
// Always avoid lexing editor placeholders when we're just running the
// preprocessor as we never want to emit the
// "editor placeholder in source file" error in PP only mode.
- if (isStrictlyPreprocessorAction(Action))
+ // Certain predefined macros which depend upon semantic processing,
+ // for example __FLT_EVAL_METHOD__, are not expanded in PP mode, they
+ // appear in the preprocessed output as an unexpanded macro name.
+ if (isStrictlyPreprocessorAction(Action)) {
Opts.LexEditorPlaceholders = false;
+ Opts.LexExpandSpecialBuiltins = false;
+ }
return Diags.getNumErrors() == NumErrorsBefore;
}