def MQ : JoinedOrSeparate<["-"], "MQ">, Group<M_Group>, Flags<[CC1Option]>,
HelpText<"Specify name of main file output to quote in depfile">;
def MT : JoinedOrSeparate<["-"], "MT">, Group<M_Group>, Flags<[CC1Option]>,
- HelpText<"Specify name of main file output in depfile">;
+ HelpText<"Specify name of main file output in depfile">,
+ MarshallingInfoStringVector<"DependencyOutputOpts.Targets">;
def MV : Flag<["-"], "MV">, Group<M_Group>, Flags<[CC1Option]>,
HelpText<"Use NMake/Jom format for the depfile">,
MarshallingInfoFlag<"DependencyOutputOpts.OutputFormat", "DependencyOutputFormat::Make">,
MetaVarName<"<arg>">, Group<Preprocessor_Group>;
def Wundef_prefix_EQ : CommaJoined<["-"], "Wundef-prefix=">, Group<W_value_Group>,
Flags<[CC1Option, CoreOption, HelpHidden]>, MetaVarName<"<arg>">,
- HelpText<"Enable warnings for undefined macros with a prefix in the comma separated list <arg>">;
+ HelpText<"Enable warnings for undefined macros with a prefix in the comma separated list <arg>">,
+ MarshallingInfoStringVector<"DiagnosticOpts->UndefPrefixes">;
def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
def W_Joined : Joined<["-"], "W">, Group<W_Group>, Flags<[CC1Option, CoreOption]>,
Flags<[CoreOption, NoXarchOption]>;
def fsanitize_blacklist : Joined<["-"], "fsanitize-blacklist=">,
Group<f_clang_Group>,
- HelpText<"Path to blacklist file for sanitizers">;
+ HelpText<"Path to blacklist file for sanitizers">,
+ MarshallingInfoStringVector<"LangOpts->SanitizerBlacklistFiles">;
def fsanitize_system_blacklist : Joined<["-"], "fsanitize-system-blacklist=">,
HelpText<"Path to system blacklist file for sanitizers">,
Flags<[CC1Option]>;
"Sanitizers">, Values<"func,bb,edge,indirect-calls,trace-bb,trace-cmp,trace-div,trace-gep,8bit-counters,trace-pc,trace-pc-guard,no-prune,inline-8bit-counters,inline-bool-flag">;
def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
- HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">;
+ HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
+ MarshallingInfoStringVector<"CodeGenOpts.SanitizeCoverageAllowlistFiles">;
def : Joined<["-"], "fsanitize-coverage-whitelist=">,
Group<f_clang_Group>, Flags<[CoreOption, HelpHidden]>, Alias<fsanitize_coverage_allowlist>,
HelpText<"Deprecated, use -fsanitize-coverage-allowlist= instead">;
def fsanitize_coverage_blocklist : Joined<["-"], "fsanitize-coverage-blocklist=">,
Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
- HelpText<"Disable sanitizer coverage instrumentation for modules and functions that match the provided special case list, even the allowed ones">;
+ HelpText<"Disable sanitizer coverage instrumentation for modules and functions that match the provided special case list, even the allowed ones">,
+ MarshallingInfoStringVector<"CodeGenOpts.SanitizeCoverageBlocklistFiles">;
def : Joined<["-"], "fsanitize-coverage-blacklist=">,
Group<f_clang_Group>, Flags<[CoreOption, HelpHidden]>, Alias<fsanitize_coverage_blocklist>,
HelpText<"Deprecated, use -fsanitize-coverage-blocklist= instead">;
def frewrite_map_file : Separate<["-"], "frewrite-map-file">,
Group<f_Group>,
- Flags<[ NoXarchOption, CC1Option ]>;
+ Flags<[ NoXarchOption, CC1Option ]>,
+ MarshallingInfoStringVector<"CodeGenOpts.RewriteMapFiles">;
def frewrite_map_file_EQ : Joined<["-"], "frewrite-map-file=">,
Group<f_Group>,
Flags<[NoXarchOption]>;
def fxray_always_instrument :
JoinedOrSeparate<["-"], "fxray-always-instrument=">,
Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">;
+ HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">,
+ MarshallingInfoStringVector<"LangOpts->XRayAlwaysInstrumentFiles">;
def fxray_never_instrument :
JoinedOrSeparate<["-"], "fxray-never-instrument=">,
Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">;
+ HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">,
+ MarshallingInfoStringVector<"LangOpts->XRayNeverInstrumentFiles">;
def fxray_attr_list :
JoinedOrSeparate<["-"], "fxray-attr-list=">,
Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">;
+ HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">,
+ MarshallingInfoStringVector<"LangOpts->XRayAttrListFiles">;
def fxray_modes :
JoinedOrSeparate<["-"], "fxray-modes=">,
Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Load the named plugin (dynamic shared object)">;
def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<dsopath>">,
- HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">;
+ HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">,
+ MarshallingInfoStringVector<"CodeGenOpts.PassPlugins">;
defm preserve_as_comments : BoolFOption<"preserve-as-comments",
"CodeGenOpts.PreserveAsmComments", DefaultsToTrue,
ChangedBy<NegFlag, [], "Do not preserve comments in inline assembly">,
"absolute paths are relative to -isysroot">,
MetaVarName<"<directory>">, Flags<[CC1Option]>;
def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>, Flags<[CC1Option]>,
- HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">;
+ HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">,
+ MarshallingInfoStringVector<"PreprocessorOpts->MacroIncludes">;
def image__base : Separate<["-"], "image_base">;
def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
MetaVarName<"<file>">, HelpText<"Include file before parsing">, Flags<[CC1Option]>;
def mlinker_version_EQ : Joined<["-"], "mlinker-version=">,
Flags<[NoXarchOption]>;
def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option,CC1AsOption,CoreOption]>,
- HelpText<"Additional arguments to forward to LLVM's option processing">;
+ HelpText<"Additional arguments to forward to LLVM's option processing">,
+ MarshallingInfoStringVector<"FrontendOpts.LLVMArgs">;
def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
Group<m_Group>, HelpText<"Set Mac OS X deployment target">;
def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
HelpText<"Don't generate implicit floating point instructions">;
def mimplicit_float : Flag<["-"], "mimplicit-float">, Group<m_Group>;
def mrecip : Flag<["-"], "mrecip">, Group<m_Group>;
-def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>, Flags<[CC1Option]>;
+def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>, Flags<[CC1Option]>,
+ MarshallingInfoStringVector<"CodeGenOpts.Reciprocals">;
def mprefer_vector_width_EQ : Joined<["-"], "mprefer-vector-width=">, Group<m_Group>, Flags<[CC1Option]>,
HelpText<"Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.">,
MarshallingInfoString<"CodeGenOpts.PreferVectorWidth">;
HelpText<"Tune for a specific cpu type">,
MarshallingInfoString<"TargetOpts->TuneCPU">;
def target_feature : Separate<["-"], "target-feature">,
- HelpText<"Target specific attributes">;
+ HelpText<"Target specific attributes">,
+ MarshallingInfoStringVector<"TargetOpts->FeaturesAsWritten">;
def triple : Separate<["-"], "triple">,
HelpText<"Specify target triple (e.g. i686-apple-darwin9)">,
MarshallingInfoString<"TargetOpts->Triple", "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
HelpText<"Emit macro debug information">,
MarshallingInfoFlag<"CodeGenOpts.MacroDebugInfo">;
def default_function_attr : Separate<["-"], "default-function-attr">,
- HelpText<"Apply given attribute to all functions">;
+ HelpText<"Apply given attribute to all functions">,
+ MarshallingInfoStringVector<"CodeGenOpts.DefaultFunctionAttrs">;
def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
MarshallingInfoStringInt<"CodeGenOpts.DwarfVersion">;
def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">,
HelpText<"Run the SLP vectorization passes">,
MarshallingInfoFlag<"CodeGenOpts.VectorizeSLP">;
def dependent_lib : Joined<["--"], "dependent-lib=">,
- HelpText<"Add dependent library">;
+ HelpText<"Add dependent library">,
+ MarshallingInfoStringVector<"CodeGenOpts.DependentLibraries">;
def linker_option : Joined<["--"], "linker-option=">,
- HelpText<"Add linker option">;
+ HelpText<"Add linker option">,
+ MarshallingInfoStringVector<"CodeGenOpts.LinkerOptions">;
def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
HelpText<"Sanitizer coverage type">,
MarshallingInfoStringInt<"CodeGenOpts.SanitizeCoverageType">;
def verify_EQ : CommaJoined<["-"], "verify=">,
MetaVarName<"<prefixes>">,
HelpText<"Verify diagnostic output using comment directives that start with"
- " prefixes in the comma-separated sequence <prefixes>">;
+ " prefixes in the comma-separated sequence <prefixes>">,
+ MarshallingInfoStringVector<"DiagnosticOpts->VerifyPrefixes">;
def verify : Flag<["-"], "verify">,
HelpText<"Equivalent to -verify=expected">;
def verify_ignore_unexpected : Flag<["-"], "verify-ignore-unexpected">,
def ast_merge : Separate<["-"], "ast-merge">,
MetaVarName<"<ast file>">,
- HelpText<"Merge the given AST file into the translation unit being compiled.">;
+ HelpText<"Merge the given AST file into the translation unit being compiled.">,
+ MarshallingInfoStringVector<"FrontendOpts.ASTMergeFiles">;
def aux_target_cpu : Separate<["-"], "aux-target-cpu">,
HelpText<"Target a specific auxiliary cpu type">;
def aux_target_feature : Separate<["-"], "aux-target-feature">,
MarshallingInfoFlag<"HeaderSearchOpts->ModuleMapFileHomeIsCwd">;
def fmodule_feature : Separate<["-"], "fmodule-feature">,
MetaVarName<"<feature>">,
- HelpText<"Enable <feature> in module map requires declarations">;
+ HelpText<"Enable <feature> in module map requires declarations">,
+ MarshallingInfoStringVector<"LangOpts->ModuleFeatures">;
def fmodules_embed_file_EQ : Joined<["-"], "fmodules-embed-file=">,
MetaVarName<"<file>">,
HelpText<"Embed the contents of the specified file into the module file "
- "being compiled.">;
+ "being compiled.">,
+ MarshallingInfoStringVector<"FrontendOpts.ModulesEmbedFiles">;
def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">,
HelpText<"Embed the contents of all files read by this compilation into "
"the produced module file.">,
//===----------------------------------------------------------------------===//
def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">,
- HelpText<"OpenCL only. Enable or disable OpenCL extensions. The argument is a comma-separated sequence of one or more extension names, each prefixed by '+' or '-'.">;
+ HelpText<"OpenCL only. Enable or disable OpenCL extensions. The argument is a comma-separated sequence of one or more extension names, each prefixed by '+' or '-'.">,
+ MarshallingInfoStringVector<"TargetOpts->OpenCLExtensionsAsWritten">;
//===----------------------------------------------------------------------===//
// CUDA Options
Option::OptionClass OptClass,
unsigned TableIndex,
const std::vector<std::string> &Values) {
- if (OptClass == Option::OptionClass::CommaJoinedClass) {
+ switch (OptClass) {
+ case Option::CommaJoinedClass: {
std::string CommaJoinedValue;
if (!Values.empty()) {
CommaJoinedValue.append(Values.front());
}
denormalizeString(Args, Spelling, SA, Option::OptionClass::JoinedClass,
TableIndex, CommaJoinedValue);
- } else if (OptClass == Option::OptionClass::JoinedClass) {
+ break;
+ }
+ case Option::JoinedClass:
+ case Option::SeparateClass:
+ case Option::JoinedOrSeparateClass:
for (const std::string &Value : Values)
denormalizeString(Args, Spelling, SA, OptClass, TableIndex, Value);
+ break;
+ default:
+ llvm_unreachable("Cannot denormalize an option with option class "
+ "incompatible with string vector denormalization.");
}
}
}
}
- Opts.Reciprocals = Args.getAllArgValues(OPT_mrecip_EQ);
-
// Basic Block Sections implies Function Sections.
Opts.FunctionSections =
Args.hasArg(OPT_ffunction_sections) ||
}
Opts.LinkBitcodeFiles.push_back(F);
}
- Opts.SanitizeCoverageAllowlistFiles =
- Args.getAllArgValues(OPT_fsanitize_coverage_allowlist);
- Opts.SanitizeCoverageBlocklistFiles =
- Args.getAllArgValues(OPT_fsanitize_coverage_blocklist);
Opts.SSPBufferSize =
getLastArgIntValue(Args, OPT_stack_protector_buffer_size, 8, Diags);
}
}
- Opts.DependentLibraries = Args.getAllArgValues(OPT_dependent_lib);
- Opts.LinkerOptions = Args.getAllArgValues(OPT_linker_option);
bool NeedLocTracking = false;
if (!Opts.OptRecordFile.empty())
if (NeedLocTracking && Opts.getDebugInfo() == codegenoptions::NoDebugInfo)
Opts.setDebugInfo(codegenoptions::LocTrackingOnly);
- Opts.RewriteMapFiles = Args.getAllArgValues(OPT_frewrite_map_file);
-
// Parse -fsanitize-recover= arguments.
// FIXME: Report unrecoverable sanitizers incorrectly specified here.
parseSanitizerKinds("-fsanitize-recover=",
Opts.EmitVersionIdentMetadata = Args.hasFlag(OPT_Qy, OPT_Qn, true);
- Opts.DefaultFunctionAttrs = Args.getAllArgValues(OPT_default_function_attr);
-
- Opts.PassPlugins = Args.getAllArgValues(OPT_fpass_plugin_EQ);
-
return Success;
}
static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
ArgList &Args) {
- Opts.Targets = Args.getAllArgValues(OPT_MT);
if (Args.hasArg(OPT_show_includes)) {
// Writing both /showIncludes and preprocessor output to stdout
// would produce interleaved output, so use stderr for /showIncludes.
Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits);
Opts.ShowPresumedLoc = !Args.hasArg(OPT_fno_diagnostics_use_presumed_location);
Opts.VerifyDiagnostics = Args.hasArg(OPT_verify) || Args.hasArg(OPT_verify_EQ);
- Opts.VerifyPrefixes = Args.getAllArgValues(OPT_verify_EQ);
if (Args.hasArg(OPT_verify))
Opts.VerifyPrefixes.push_back("expected");
// Keep VerifyPrefixes in its original order for the sake of diagnostics, and
Opts.MessageLength =
getLastArgIntValue(Args, OPT_fmessage_length_EQ, 0, Diags);
- Opts.UndefPrefixes = Args.getAllArgValues(OPT_Wundef_prefix_EQ);
-
addDiagnosticArgs(Args, OPT_W_Group, OPT_W_value_Group, Opts.Warnings);
addDiagnosticArgs(Args, OPT_R_Group, OPT_R_value_Group, Opts.Remarks);
}
Opts.Plugins = Args.getAllArgValues(OPT_load);
- Opts.ASTMergeFiles = Args.getAllArgValues(OPT_ast_merge);
- Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm);
Opts.ASTDumpDecls = Args.hasArg(OPT_ast_dump, OPT_ast_dump_EQ);
Opts.ASTDumpAll = Args.hasArg(OPT_ast_dump_all, OPT_ast_dump_all_EQ);
// Only the -fmodule-file=<file> form.
if (Val.find('=') == StringRef::npos)
Opts.ModuleFiles.push_back(std::string(Val));
}
- Opts.ModulesEmbedFiles = Args.getAllArgValues(OPT_fmodules_embed_file_EQ);
Opts.AllowPCMWithCompilerErrors = Args.hasArg(OPT_fallow_pcm_with_errors);
if (Opts.ProgramAction != frontend::GenerateModule && Opts.IsSystemModule)
|| Args.hasArg(OPT_fdump_record_layouts);
if (Opts.FastRelaxedMath)
Opts.setDefaultFPContractMode(LangOptions::FPM_Fast);
- Opts.ModuleFeatures = Args.getAllArgValues(OPT_fmodule_feature);
llvm::sort(Opts.ModuleFeatures);
Opts.NativeHalfType |= Args.hasArg(OPT_fnative_half_type);
Opts.NativeHalfArgsAndReturns |= Args.hasArg(OPT_fnative_half_arguments_and_returns);
// Parse -fsanitize= arguments.
parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ),
Diags, Opts.Sanitize);
- Opts.SanitizerBlacklistFiles = Args.getAllArgValues(OPT_fsanitize_blacklist);
std::vector<std::string> systemBlacklists =
Args.getAllArgValues(OPT_fsanitize_system_blacklist);
Opts.SanitizerBlacklistFiles.insert(Opts.SanitizerBlacklistFiles.end(),
systemBlacklists.begin(),
systemBlacklists.end());
- // -fxray-{always,never}-instrument= filenames.
- Opts.XRayAlwaysInstrumentFiles =
- Args.getAllArgValues(OPT_fxray_always_instrument);
- Opts.XRayNeverInstrumentFiles =
- Args.getAllArgValues(OPT_fxray_never_instrument);
- Opts.XRayAttrListFiles = Args.getAllArgValues(OPT_fxray_attr_list);
-
if (Arg *A = Args.getLastArg(OPT_fclang_abi_compat_EQ)) {
Opts.setClangABICompat(LangOptions::ClangABI::Latest);
Opts.addMacroUndef(A->getValue());
}
- Opts.MacroIncludes = Args.getAllArgValues(OPT_imacros);
-
// Add the ordered list of -includes.
for (const auto *A : Args.filtered(OPT_include))
Opts.Includes.emplace_back(A->getValue());
static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args,
DiagnosticsEngine &Diags) {
- Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
- Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues(OPT_cl_ext_EQ);
Opts.AllowAMDGPUUnsafeFPAtomics =
Args.hasFlag(options::OPT_munsafe_fp_atomics,
options::OPT_mno_unsafe_fp_atomics, false);