Skip to content

Commit 76b1cb5

Browse files
committed
Fix flag handling
1 parent ce363cd commit 76b1cb5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,10 +1432,14 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc,
14321432
opts.setFPContractMode(Fortran::common::LangOptions::FPM_Fast);
14331433
}
14341434

1435-
if (args.hasArg(clang::driver::options::OPT_ffast_real_mod))
1436-
opts.FastRealMod = true;
1437-
if (args.hasArg(clang::driver::options::OPT_fno_fast_real_mod))
1438-
opts.FastRealMod = false;
1435+
if (llvm::opt::Arg *arg =
1436+
args.getLastArg(clang::driver::options::OPT_ffast_real_mod,
1437+
clang::driver::options::OPT_fno_fast_real_mod)) {
1438+
if (arg->getOption().matches(clang::driver::options::OPT_ffast_real_mod))
1439+
opts.FastRealMod = true;
1440+
if (arg->getOption().matches(clang::driver::options::OPT_fno_fast_real_mod))
1441+
opts.FastRealMod = false;
1442+
}
14391443

14401444
return true;
14411445
}

0 commit comments

Comments
 (0)