@@ -328,8 +328,29 @@ static void denormalizeStringVector(SmallVectorImpl<const char *> &Args,
328328 Option::OptionClass OptClass,
329329 unsigned TableIndex,
330330 const std::vector<std::string> &Values) {
331- for (const std::string &Value : Values) {
332- denormalizeString (Args, Spelling, SA, OptClass, TableIndex, Value);
331+ switch (OptClass) {
332+ case Option::CommaJoinedClass: {
333+ std::string CommaJoinedValue;
334+ if (!Values.empty ()) {
335+ CommaJoinedValue.append (Values.front ());
336+ for (const std::string &Value : llvm::drop_begin (Values, 1 )) {
337+ CommaJoinedValue.append (" ," );
338+ CommaJoinedValue.append (Value);
339+ }
340+ }
341+ denormalizeString (Args, Spelling, SA, Option::OptionClass::JoinedClass,
342+ TableIndex, CommaJoinedValue);
343+ break ;
344+ }
345+ case Option::JoinedClass:
346+ case Option::SeparateClass:
347+ case Option::JoinedOrSeparateClass:
348+ for (const std::string &Value : Values)
349+ denormalizeString (Args, Spelling, SA, OptClass, TableIndex, Value);
350+ break ;
351+ default :
352+ llvm_unreachable (" Cannot denormalize an option with option class "
353+ " incompatible with string vector denormalization." );
333354 }
334355}
335356
@@ -786,7 +807,6 @@ static void parseAnalyzerConfigs(AnalyzerOptions &AnOpts,
786807}
787808
788809static void ParseCommentArgs (CommentOptions &Opts, ArgList &Args) {
789- Opts.BlockCommandNames = Args.getAllArgValues (OPT_fcomment_block_commands);
790810 Opts.ParseAllComments = Args.hasArg (OPT_fparse_all_comments);
791811}
792812
@@ -991,8 +1011,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
9911011 }
9921012 }
9931013
994- Opts.Reciprocals = Args.getAllArgValues (OPT_mrecip_EQ);
995-
9961014 // Basic Block Sections implies Function Sections.
9971015 Opts.FunctionSections =
9981016 Args.hasArg (OPT_ffunction_sections) ||
@@ -1122,10 +1140,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
11221140 }
11231141 Opts.LinkBitcodeFiles .push_back (F);
11241142 }
1125- Opts.SanitizeCoverageAllowlistFiles =
1126- Args.getAllArgValues (OPT_fsanitize_coverage_allowlist);
1127- Opts.SanitizeCoverageBlocklistFiles =
1128- Args.getAllArgValues (OPT_fsanitize_coverage_blocklist);
11291143 Opts.SSPBufferSize =
11301144 getLastArgIntValue (Args, OPT_stack_protector_buffer_size, 8 , Diags);
11311145
@@ -1207,8 +1221,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
12071221 }
12081222 }
12091223
1210- Opts.DependentLibraries = Args.getAllArgValues (OPT_dependent_lib);
1211- Opts.LinkerOptions = Args.getAllArgValues (OPT_linker_option);
12121224 bool NeedLocTracking = false ;
12131225
12141226 if (!Opts.OptRecordFile .empty ())
@@ -1282,8 +1294,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
12821294 if (NeedLocTracking && Opts.getDebugInfo () == codegenoptions::NoDebugInfo)
12831295 Opts.setDebugInfo (codegenoptions::LocTrackingOnly);
12841296
1285- Opts.RewriteMapFiles = Args.getAllArgValues (OPT_frewrite_map_file);
1286-
12871297 // Parse -fsanitize-recover= arguments.
12881298 // FIXME: Report unrecoverable sanitizers incorrectly specified here.
12891299 parseSanitizerKinds (" -fsanitize-recover=" ,
@@ -1295,10 +1305,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
12951305
12961306 Opts.EmitVersionIdentMetadata = Args.hasFlag (OPT_Qy, OPT_Qn, true );
12971307
1298- Opts.DefaultFunctionAttrs = Args.getAllArgValues (OPT_default_function_attr);
1299-
1300- Opts.PassPlugins = Args.getAllArgValues (OPT_fpass_plugin_EQ);
1301-
13021308 return Success;
13031309}
13041310
@@ -1484,7 +1490,6 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
14841490 Opts.ShowParseableFixits = Args.hasArg (OPT_fdiagnostics_parseable_fixits);
14851491 Opts.ShowPresumedLoc = !Args.hasArg (OPT_fno_diagnostics_use_presumed_location);
14861492 Opts.VerifyDiagnostics = Args.hasArg (OPT_verify) || Args.hasArg (OPT_verify_EQ);
1487- Opts.VerifyPrefixes = Args.getAllArgValues (OPT_verify_EQ);
14881493 if (Args.hasArg (OPT_verify))
14891494 Opts.VerifyPrefixes .push_back (" expected" );
14901495 // Keep VerifyPrefixes in its original order for the sake of diagnostics, and
@@ -1531,8 +1536,6 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
15311536 Opts.MessageLength =
15321537 getLastArgIntValue (Args, OPT_fmessage_length_EQ, 0 , Diags);
15331538
1534- Opts.UndefPrefixes = Args.getAllArgValues (OPT_Wundef_prefix_EQ);
1535-
15361539 addDiagnosticArgs (Args, OPT_W_Group, OPT_W_value_Group, Opts.Warnings );
15371540 addDiagnosticArgs (Args, OPT_R_Group, OPT_R_value_Group, Opts.Remarks );
15381541
@@ -1729,8 +1732,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
17291732 }
17301733
17311734 Opts.Plugins = Args.getAllArgValues (OPT_load);
1732- Opts.ASTMergeFiles = Args.getAllArgValues (OPT_ast_merge);
1733- Opts.LLVMArgs = Args.getAllArgValues (OPT_mllvm);
17341735 Opts.ASTDumpDecls = Args.hasArg (OPT_ast_dump, OPT_ast_dump_EQ);
17351736 Opts.ASTDumpAll = Args.hasArg (OPT_ast_dump_all, OPT_ast_dump_all_EQ);
17361737 // Only the -fmodule-file=<file> form.
@@ -1739,7 +1740,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
17391740 if (Val.find (' =' ) == StringRef::npos)
17401741 Opts.ModuleFiles .push_back (std::string (Val));
17411742 }
1742- Opts.ModulesEmbedFiles = Args.getAllArgValues (OPT_fmodules_embed_file_EQ);
17431743 Opts.AllowPCMWithCompilerErrors = Args.hasArg (OPT_fallow_pcm_with_errors);
17441744
17451745 if (Opts.ProgramAction != frontend::GenerateModule && Opts.IsSystemModule )
@@ -2574,7 +2574,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
25742574 || Args.hasArg (OPT_fdump_record_layouts);
25752575 if (Opts.FastRelaxedMath )
25762576 Opts.setDefaultFPContractMode (LangOptions::FPM_Fast);
2577- Opts.ModuleFeatures = Args.getAllArgValues (OPT_fmodule_feature);
25782577 llvm::sort (Opts.ModuleFeatures );
25792578 Opts.NativeHalfType |= Args.hasArg (OPT_fnative_half_type);
25802579 Opts.NativeHalfArgsAndReturns |= Args.hasArg (OPT_fnative_half_arguments_and_returns);
@@ -2782,20 +2781,12 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
27822781 // Parse -fsanitize= arguments.
27832782 parseSanitizerKinds (" -fsanitize=" , Args.getAllArgValues (OPT_fsanitize_EQ),
27842783 Diags, Opts.Sanitize );
2785- Opts.SanitizerBlacklistFiles = Args.getAllArgValues (OPT_fsanitize_blacklist);
27862784 std::vector<std::string> systemBlacklists =
27872785 Args.getAllArgValues (OPT_fsanitize_system_blacklist);
27882786 Opts.SanitizerBlacklistFiles .insert (Opts.SanitizerBlacklistFiles .end (),
27892787 systemBlacklists.begin (),
27902788 systemBlacklists.end ());
27912789
2792- // -fxray-{always,never}-instrument= filenames.
2793- Opts.XRayAlwaysInstrumentFiles =
2794- Args.getAllArgValues (OPT_fxray_always_instrument);
2795- Opts.XRayNeverInstrumentFiles =
2796- Args.getAllArgValues (OPT_fxray_never_instrument);
2797- Opts.XRayAttrListFiles = Args.getAllArgValues (OPT_fxray_attr_list);
2798-
27992790 if (Arg *A = Args.getLastArg (OPT_fclang_abi_compat_EQ)) {
28002791 Opts.setClangABICompat (LangOptions::ClangABI::Latest);
28012792
@@ -2970,8 +2961,6 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
29702961 Opts.addMacroUndef (A->getValue ());
29712962 }
29722963
2973- Opts.MacroIncludes = Args.getAllArgValues (OPT_imacros);
2974-
29752964 // Add the ordered list of -includes.
29762965 for (const auto *A : Args.filtered (OPT_include))
29772966 Opts.Includes .emplace_back (A->getValue ());
@@ -3010,8 +2999,6 @@ static void ParsePreprocessorOutputArgs(PreprocessorOutputOptions &Opts,
30102999
30113000static void ParseTargetArgs (TargetOptions &Opts, ArgList &Args,
30123001 DiagnosticsEngine &Diags) {
3013- Opts.FeaturesAsWritten = Args.getAllArgValues (OPT_target_feature);
3014- Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues (OPT_cl_ext_EQ);
30153002 Opts.AllowAMDGPUUnsafeFPAtomics =
30163003 Args.hasFlag (options::OPT_munsafe_fp_atomics,
30173004 options::OPT_mno_unsafe_fp_atomics, false );
0 commit comments