Frontend: simplify some flag logic (NFC)

Using the three parameter form of `hasFlag` makes it possible to fold
away the conditional code.  NFC.
This commit is contained in:
Saleem Abdulrasool
2017-10-09 14:37:57 -07:00
parent bcb9571079
commit 54f80d9f32

View File

@@ -1132,13 +1132,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
}
#endif
Opts.EnableObjCInterop = Target.isOSDarwin();
if (auto A = Args.getLastArg(OPT_enable_objc_interop,
OPT_disable_objc_interop)) {
Opts.EnableObjCInterop
= A->getOption().matches(OPT_enable_objc_interop);
}
Opts.EnableObjCInterop =
Args.hasFlag(OPT_enable_objc_interop, OPT_disable_objc_interop,
Target.isOSDarwin());
Opts.EnableSILOpaqueValues |= Args.hasArg(OPT_enable_sil_opaque_values);
// Must be processed after any other language options that could affect