diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3071,10 +3071,10 @@ def mno_wavefrontsize64 : Flag<["-"], "mno-wavefrontsize64">, Group, HelpText<"Specify wavefront size 32 mode (AMDGPU only)">; -def munsafe_fp_atomics : Flag<["-"], "munsafe-fp-atomics">, Group, - HelpText<"Enable unsafe floating point atomic instructions (AMDGPU only)">, - Flags<[CC1Option]>; -def mno_unsafe_fp_atomics : Flag<["-"], "mno-unsafe-fp-atomics">, Group; +defm unsafe_fp_atomics : BoolCC1Option<"unsafe-fp-atomics", + TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultsToFalse, + ChangedBy, + ResetBy, BothFlags<[]>, "m">, Group; def faltivec : Flag<["-"], "faltivec">, Group, Flags<[NoXarchOption]>; def fno_altivec : Flag<["-"], "fno-altivec">, Group, Flags<[NoXarchOption]>; @@ -4378,7 +4378,10 @@ MarshallingInfoFlag>; def analyzer_config_compatibility_mode : Separate<["-"], "analyzer-config-compatibility-mode">, - HelpText<"Don't emit errors on invalid analyzer-config inputs">; + HelpText<"Don't emit errors on invalid analyzer-config inputs">, + Values<"true,false">, NormalizedValues<[[{false}], [{true}]]>, + MarshallingInfoString, [{true}]>, + AutoNormalizeEnum; def analyzer_config_compatibility_mode_EQ : Joined<["-"], "analyzer-config-compatibility-mode=">, Alias; @@ -4842,7 +4845,8 @@ MetaVarName<" ">, HelpText<"Pass to plugin ">; def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"">, - HelpText<"Use the named plugin action in addition to the default action">; + HelpText<"Use the named plugin action in addition to the default action">, + MarshallingInfoStringVector>; def ast_dump_filter : Separate<["-"], "ast-dump-filter">, MetaVarName<"">, HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration" @@ -5118,10 +5122,13 @@ def fno_validate_pch : Flag<["-"], "fno-validate-pch">, HelpText<"Disable validation of precompiled headers">, MarshallingInfoFlag>; -def fallow_pch_with_errors : Flag<["-"], "fallow-pch-with-compiler-errors">, - HelpText<"Accept a PCH file that was created with compiler errors">; def fallow_pcm_with_errors : Flag<["-"], "fallow-pcm-with-compiler-errors">, - HelpText<"Accept a PCM file that was created with compiler errors">; + HelpText<"Accept a PCM file that was created with compiler errors">, + MarshallingInfoFlag>; +def fallow_pch_with_errors : Flag<["-"], "fallow-pch-with-compiler-errors">, + HelpText<"Accept a PCH file that was created with compiler errors">, + MarshallingInfoFlag>, + ImpliedByAnyOf<[fallow_pcm_with_errors]>; def dump_deserialized_pch_decls : Flag<["-"], "dump-deserialized-decls">, HelpText<"Dump declarations that are deserialized from PCH, for testing">, MarshallingInfoFlag>; diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -634,13 +634,6 @@ } } - Opts.ShouldEmitErrorsOnInvalidConfigValue = - /* negated */!llvm::StringSwitch( - Args.getLastArgValue(OPT_analyzer_config_compatibility_mode)) - .Case("true", true) - .Case("false", false) - .Default(false); - Opts.CheckersAndPackages.clear(); for (const Arg *A : Args.filtered(OPT_analyzer_checker, OPT_analyzer_disable_checker)) { @@ -828,10 +821,6 @@ << "a filename"; } -static void ParseCommentArgs(CommentOptions &Opts, ArgList &Args) { - Opts.ParseAllComments = Args.hasArg(OPT_fparse_all_comments); -} - /// Create a new Regex instance out of the string value in \p RpassArg. /// It returns a pointer to the newly generated Regex instance. static std::shared_ptr @@ -1645,7 +1634,6 @@ Opts.ProgramAction = frontend::PluginAction; Opts.ActionName = A->getValue(); } - Opts.AddPluginActions = Args.getAllArgValues(OPT_add_plugin); for (const auto *AA : Args.filtered(OPT_plugin_arg)) Opts.PluginArgs[AA->getValue(0)].emplace_back(AA->getValue(1)); @@ -1686,7 +1674,6 @@ if (Val.find('=') == StringRef::npos) Opts.ModuleFiles.push_back(std::string(Val)); } - Opts.AllowPCMWithCompilerErrors = Args.hasArg(OPT_fallow_pcm_with_errors); if (Opts.ProgramAction != frontend::GenerateModule && Opts.IsSystemModule) Diags.Report(diag::err_drv_argument_only_allowed_with) << "-fsystem-module" @@ -2845,8 +2832,6 @@ frontend::ActionKind Action) { Opts.PCHWithHdrStop = Args.hasArg(OPT_pch_through_hdrstop_create) || Args.hasArg(OPT_pch_through_hdrstop_use); - Opts.AllowPCHWithCompilerErrors = - Args.hasArg(OPT_fallow_pch_with_errors, OPT_fallow_pcm_with_errors); for (const auto *A : Args.filtered(OPT_error_on_deserialized_pch_decl)) Opts.DeserializedPCHDeclsToErrorOn.insert(A->getValue()); @@ -2930,9 +2915,6 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args, DiagnosticsEngine &Diags) { - Opts.AllowAMDGPUUnsafeFPAtomics = - Args.hasFlag(options::OPT_munsafe_fp_atomics, - options::OPT_mno_unsafe_fp_atomics, false); if (Arg *A = Args.getLastArg(options::OPT_target_sdk_version_EQ)) { llvm::VersionTuple Version; if (Version.tryParse(A->getValue())) @@ -2987,7 +2969,6 @@ } Success &= ParseDiagnosticArgs(Res.getDiagnosticOpts(), Args, &Diags, /*DefaultDiagColor=*/false); - ParseCommentArgs(LangOpts.CommentOpts, Args); // FIXME: We shouldn't have to pass the DashX option around here InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), Args, Diags, LangOpts.IsHeaderFile);