diff options
author | Tom Eccles <tom.eccles@arm.com> | 2022-10-19 10:33:12 +0000 |
---|---|---|
committer | Tom Eccles <tom.eccles@arm.com> | 2022-11-04 17:22:35 +0000 |
commit | c4dc3c029416a25103d631e8dc5422f65c076376 (patch) | |
tree | 7085c0010d740b47f358b175c62981f2381d5403 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | b5b8a8cfbe1ee3c2d3684dd62e7f0ddeeeb73273 (diff) | |
download | llvm-c4dc3c029416a25103d631e8dc5422f65c076376.zip llvm-c4dc3c029416a25103d631e8dc5422f65c076376.tar.gz llvm-c4dc3c029416a25103d631e8dc5422f65c076376.tar.bz2 |
[flang] Add -f[no-]associative-math and -mreassociate
Only add the option processing and store the result. No attributes are
added to FIR yet.
Clang only forwards -mreassociate
if (AssociativeMath && !SignedZeros && !TrappingMath)
Flang doesn't have -f[no-]trapping-math, so this part of the condition
has been omitted. !TrappingMath is the default.
Differential Revision: https://reviews.llvm.org/D137329
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index eeadb21..8c0bdcd 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -720,6 +720,12 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc, opts.NoSignedZeros = true; } + if (const llvm::opt::Arg *a = + args.getLastArg(clang::driver::options::OPT_mreassociate)) { + diags.Report(diagUnimplemented) << a->getOption().getName(); + opts.AssociativeMath = true; + } + return true; } |