Skip to content

Commit 8d4d181

Browse files
committed
Fix flag handling
1 parent e449ea8 commit 8d4d181

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
@@ -1407,10 +1407,14 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc,
14071407
opts.setFPContractMode(Fortran::common::LangOptions::FPM_Fast);
14081408
}
14091409

1410-
if (args.hasArg(clang::options::OPT_ffast_real_mod))
1411-
opts.FastRealMod = true;
1412-
if (args.hasArg(clang::options::OPT_fno_fast_real_mod))
1413-
opts.FastRealMod = false;
1410+
if (llvm::opt::Arg *arg =
1411+
args.getLastArg(clang::options::OPT_ffast_real_mod,
1412+
clang::options::OPT_fno_fast_real_mod)) {
1413+
if (arg->getOption().matches(clang::options::OPT_ffast_real_mod))
1414+
opts.FastRealMod = true;
1415+
if (arg->getOption().matches(clang::options::OPT_fno_fast_real_mod))
1416+
opts.FastRealMod = false;
1417+
}
14141418

14151419
return true;
14161420
}

0 commit comments

Comments
 (0)