diff options
author | Zahira Ammarguellat <zahira.ammarguellat@intel.com> | 2021-10-19 09:12:57 -0700 |
---|---|---|
committer | Zahira Ammarguellat <zahira.ammarguellat@intel.com> | 2022-02-23 15:00:18 -0800 |
commit | 1592d88aa7bc13c9f53cf09d25b98e7318a57bfb (patch) | |
tree | d6e4e5f200151ea2deb4ca8f1e3354dadd8fc0db /clang/lib/Parse/ParseStmt.cpp | |
parent | 924032c592658b19d9e1faeef0fea14414814f39 (diff) | |
download | llvm-1592d88aa7bc13c9f53cf09d25b98e7318a57bfb.zip llvm-1592d88aa7bc13c9f53cf09d25b98e7318a57bfb.tar.gz llvm-1592d88aa7bc13c9f53cf09d25b98e7318a57bfb.tar.bz2 |
Add support for floating-point option `ffp-eval-method` and for
`pragma clang fp eval_method`.
Differential Revision: https://reviews.llvm.org/D109239
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index ee07775..cadedf6 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1153,6 +1153,16 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) { if (R.isUsable()) Stmts.push_back(R.get()); } + // Warn the user that using option `-ffp-eval-method=source` on a + // 32-bit target and feature `sse` disabled, or using + // `pragma clang fp eval_method=source` and feature `sse` disabled, is not + // supported. + if (!PP.getTargetInfo().supportSourceEvalMethod() && + (PP.getLastFPEvalPragmaLocation().isValid() || + PP.getCurrentFPEvalMethod() == + LangOptions::FPEvalMethodKind::FEM_Source)) + Diag(Tok.getLocation(), + diag::warn_no_support_for_eval_method_source_on_m32); SourceLocation CloseLoc = Tok.getLocation(); |