dang created this revision.
Herald added subscribers: cfe-commits, dexonsmith.
Herald added a project: clang.
Depends on D84668 <https://reviews.llvm.org/D84668>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84669
Files:
clang/include/clang/Basic/CodeGenOptions.h
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Driver/Options.td
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Profile/c-generate.c
Index: clang/test/Profile/c-generate.c
===================================================================
--- clang/test/Profile/c-generate.c
+++ clang/test/Profile/c-generate.c
@@ -7,7 +7,7 @@
//
// PROF-INSTR-NONE-NOT: __llvm_prf
//
-// PROF-INSTR-GARBAGE: invalid PGO instrumentor in argument '-fprofile-instrument=garbage'
+// PROF-INSTR-GARBAGE: invalid value 'garbage' in '-fprofile-instrument=garbage'
int main(void) {
return 0;
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -308,16 +308,19 @@
return KeyPath & Value;
}
-static void FixupInvocation(CompilerInvocation &Invocation,
+static void FixupInvocation(const ArgList &Args, CompilerInvocation &Invocation,
DiagnosticsEngine &Diags) {
LangOptions &LangOpts = *Invocation.getLangOpts();
DiagnosticOptions &DiagOpts = Invocation.getDiagnosticOpts();
CodeGenOptions &CodeGenOpts = Invocation.getCodeGenOpts();
FrontendOptions &FrontendOpts = Invocation.getFrontendOpts();
+ TargetOptions &TargetOpts = Invocation.getTargetOpts();
CodeGenOpts.XRayInstrumentFunctions = LangOpts.XRayInstrument;
CodeGenOpts.XRayAlwaysEmitCustomEvents = LangOpts.XRayAlwaysEmitCustomEvents;
CodeGenOpts.XRayAlwaysEmitTypedEvents = LangOpts.XRayAlwaysEmitTypedEvents;
CodeGenOpts.DisableFree = FrontendOpts.DisableFree;
+ CodeGenOpts.CodeModel = TargetOpts.CodeModel;
+
FrontendOpts.GenerateGlobalModuleIndex = FrontendOpts.UseGlobalModuleIndex;
LangOpts.Optimize = CodeGenOpts.OptimizationLevel != 0;
@@ -329,6 +332,11 @@
if (LangOpts.AppleKext && !LangOpts.CPlusPlus)
Diags.Report(diag::warn_c_kext);
+
+ if (CodeGenOpts.ThreadModel != "posix" && CodeGenOpts.ThreadModel != "single")
+ Diags.Report(diag::err_drv_invalid_value)
+ << Args.getLastArg(OPT_mthread_model)->getAsString(Args)
+ << CodeGenOpts.ThreadModel;
}
//===----------------------------------------------------------------------===//
@@ -770,28 +778,6 @@
}
}
-// Set the profile kind for fprofile-instrument.
-static void setPGOInstrumentor(CodeGenOptions &Opts, ArgList &Args,
- DiagnosticsEngine &Diags) {
- Arg *A = Args.getLastArg(OPT_fprofile_instrument_EQ);
- if (A == nullptr)
- return;
- StringRef S = A->getValue();
- unsigned I = llvm::StringSwitch<unsigned>(S)
- .Case("none", CodeGenOptions::ProfileNone)
- .Case("clang", CodeGenOptions::ProfileClangInstr)
- .Case("llvm", CodeGenOptions::ProfileIRInstr)
- .Case("csllvm", CodeGenOptions::ProfileCSIRInstr)
- .Default(~0U);
- if (I == ~0U) {
- Diags.Report(diag::err_drv_invalid_pgo_instrumentor) << A->getAsString(Args)
- << S;
- return;
- }
- auto Instrumentor = static_cast<CodeGenOptions::ProfileInstrKind>(I);
- Opts.setProfileInstr(Instrumentor);
-}
-
// Set the profile kind using fprofile-instrument-use-path.
static void setPGOUseInstrumentor(CodeGenOptions &Opts,
const Twine &ProfileName) {
@@ -853,52 +839,6 @@
}
}
- if (Arg *A = Args.getLastArg(OPT_fveclib)) {
- StringRef Name = A->getValue();
- if (Name == "Accelerate")
- Opts.setVecLib(CodeGenOptions::Accelerate);
- else if (Name == "MASSV")
- Opts.setVecLib(CodeGenOptions::MASSV);
- else if (Name == "SVML")
- Opts.setVecLib(CodeGenOptions::SVML);
- else if (Name == "none")
- Opts.setVecLib(CodeGenOptions::NoLibrary);
- else
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
- }
-
- if (Arg *A = Args.getLastArg(OPT_debug_info_kind_EQ)) {
- unsigned Val =
- llvm::StringSwitch<unsigned>(A->getValue())
- .Case("line-tables-only", codegenoptions::DebugLineTablesOnly)
- .Case("line-directives-only", codegenoptions::DebugDirectivesOnly)
- .Case("constructor", codegenoptions::DebugInfoConstructor)
- .Case("limited", codegenoptions::LimitedDebugInfo)
- .Case("standalone", codegenoptions::FullDebugInfo)
- .Default(~0U);
- if (Val == ~0U)
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
- << A->getValue();
- else
- Opts.setDebugInfo(static_cast<codegenoptions::DebugInfoKind>(Val));
- }
- if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) {
- unsigned Val = llvm::StringSwitch<unsigned>(A->getValue())
- .Case("gdb", unsigned(llvm::DebuggerKind::GDB))
- .Case("lldb", unsigned(llvm::DebuggerKind::LLDB))
- .Case("sce", unsigned(llvm::DebuggerKind::SCE))
- .Default(~0U);
- if (Val == ~0U)
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
- << A->getValue();
- else
- Opts.setDebuggerTuning(static_cast<llvm::DebuggerKind>(Val));
- }
- Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags);
- Opts.SplitDwarfFile = std::string(Args.getLastArgValue(OPT_split_dwarf_file));
- Opts.SplitDwarfOutput =
- std::string(Args.getLastArgValue(OPT_split_dwarf_output));
-
for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ)) {
auto Split = StringRef(Arg).split('=');
Opts.DebugPrefixMap.insert(
@@ -917,10 +857,6 @@
Opts.NewStructPathTBAA = !Args.hasArg(OPT_no_struct_path_tbaa) &&
Args.hasArg(OPT_new_struct_path_tbaa);
- Opts.DwarfDebugFlags =
- std::string(Args.getLastArgValue(OPT_dwarf_debug_flags));
- Opts.RecordCommandLine =
- std::string(Args.getLastArgValue(OPT_record_command_line));
Opts.OptimizeSize = getOptimizationLevelSize(Args);
Opts.SimplifyLibCalls = !(Args.hasArg(OPT_fno_builtin) ||
Args.hasArg(OPT_ffreestanding));
@@ -930,8 +866,6 @@
Args.hasFlag(OPT_funroll_loops, OPT_fno_unroll_loops,
(Opts.OptimizationLevel > 1));
- Opts.SampleProfileFile =
- std::string(Args.getLastArgValue(OPT_fprofile_sample_use_EQ));
Opts.DebugNameTable = static_cast<unsigned>(
Args.hasArg(OPT_ggnu_pubnames)
? llvm::DICompileUnit::DebugNameTableKind::GNU
@@ -939,63 +873,16 @@
? llvm::DICompileUnit::DebugNameTableKind::Default
: llvm::DICompileUnit::DebugNameTableKind::None);
- setPGOInstrumentor(Opts, Args, Diags);
- Opts.InstrProfileOutput =
- std::string(Args.getLastArgValue(OPT_fprofile_instrument_path_EQ));
- Opts.ProfileInstrumentUsePath =
- std::string(Args.getLastArgValue(OPT_fprofile_instrument_use_path_EQ));
if (!Opts.ProfileInstrumentUsePath.empty())
setPGOUseInstrumentor(Opts, Opts.ProfileInstrumentUsePath);
- Opts.ProfileRemappingFile =
- std::string(Args.getLastArgValue(OPT_fprofile_remapping_file_EQ));
if (!Opts.ProfileRemappingFile.empty() && !Opts.ExperimentalNewPassManager) {
Diags.Report(diag::err_drv_argument_only_allowed_with)
<< Args.getLastArg(OPT_fprofile_remapping_file_EQ)->getAsString(Args)
<< "-fexperimental-new-pass-manager";
}
- Opts.CodeModel = TargetOpts.CodeModel;
- Opts.DebugPass = std::string(Args.getLastArgValue(OPT_mdebug_pass));
-
- // Handle -mframe-pointer option.
- if (Arg *A = Args.getLastArg(OPT_mframe_pointer_EQ)) {
- CodeGenOptions::FramePointerKind FP;
- StringRef Name = A->getValue();
- bool ValidFP = true;
- if (Name == "none")
- FP = CodeGenOptions::FramePointerKind::None;
- else if (Name == "non-leaf")
- FP = CodeGenOptions::FramePointerKind::NonLeaf;
- else if (Name == "all")
- FP = CodeGenOptions::FramePointerKind::All;
- else {
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
- Success = false;
- ValidFP = false;
- }
- if (ValidFP)
- Opts.setFramePointer(FP);
- }
-
- Opts.FloatABI = std::string(Args.getLastArgValue(OPT_mfloat_abi));
- Opts.LimitFloatPrecision =
- std::string(Args.getLastArgValue(OPT_mlimit_float_precision));
Opts.Reciprocals = Args.getAllArgValues(OPT_mrecip_EQ);
- Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags);
- Opts.SmallDataLimit =
- getLastArgIntValue(Args, OPT_msmall_data_limit, 0, Diags);
- Opts.ThreadModel =
- std::string(Args.getLastArgValue(OPT_mthread_model, "posix"));
- if (Opts.ThreadModel != "posix" && Opts.ThreadModel != "single")
- Diags.Report(diag::err_drv_invalid_value)
- << Args.getLastArg(OPT_mthread_model)->getAsString(Args)
- << Opts.ThreadModel;
- Opts.TrapFuncName = std::string(Args.getLastArgValue(OPT_ftrap_function_EQ));
-
- Opts.BBSections =
- std::string(Args.getLastArgValue(OPT_fbasic_block_sections_EQ, "none"));
-
// Basic Block Sections implies Function Sections.
Opts.FunctionSections =
Args.hasArg(OPT_ffunction_sections) ||
@@ -1023,14 +910,6 @@
.Case("obj", FrontendOpts.OutputFile)
.Default(llvm::sys::path::filename(FrontendOpts.OutputFile).str());
- Opts.ThinLinkBitcodeFile =
- std::string(Args.getLastArgValue(OPT_fthin_link_bitcode_EQ));
-
- Opts.PreferVectorWidth =
- std::string(Args.getLastArgValue(OPT_mprefer_vector_width_EQ));
-
- Opts.MainFileName = std::string(Args.getLastArgValue(OPT_main_file_name));
-
if (Opts.EmitGcovArcs || Opts.EmitGcovNotes) {
Opts.CoverageDataFile =
std::string(Args.getLastArgValue(OPT_coverage_data_file));
@@ -1051,22 +930,6 @@
}
}
}
- // Handle -fembed-bitcode option.
- if (Arg *A = Args.getLastArg(OPT_fembed_bitcode_EQ)) {
- StringRef Name = A->getValue();
- unsigned Model = llvm::StringSwitch<unsigned>(Name)
- .Case("off", CodeGenOptions::Embed_Off)
- .Case("all", CodeGenOptions::Embed_All)
- .Case("bitcode", CodeGenOptions::Embed_Bitcode)
- .Case("marker", CodeGenOptions::Embed_Marker)
- .Default(~0U);
- if (Model == ~0U) {
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
- Success = false;
- } else
- Opts.setEmbedBitcode(
- static_cast<CodeGenOptions::EmbedBitcodeKind>(Model));
- }
// FIXME: For backend options that are not yet recorded as function
// attributes in the IR, keep track of them so we can embed them in a
// separate data section and use them when building the bitcode.
@@ -1091,9 +954,6 @@
}
}
- Opts.XRayInstructionThreshold =
- getLastArgIntValue(Args, OPT_fxray_instruction_threshold_EQ, 200, Diags);
-
auto XRayInstrBundles =
Args.getAllArgValues(OPT_fxray_instrumentation_bundle);
if (XRayInstrBundles.empty())
@@ -1103,11 +963,6 @@
parseXRayInstrumentationBundle("-fxray-instrumentation-bundle=", A, Args,
Diags, Opts.XRayInstrumentationBundle);
- Opts.PatchableFunctionEntryCount =
- getLastArgIntValue(Args, OPT_fpatchable_function_entry_EQ, 0, Diags);
- Opts.PatchableFunctionEntryOffset = getLastArgIntValue(
- Args, OPT_fpatchable_function_entry_offset_EQ, 0, Diags);
-
if (const Arg *A = Args.getLastArg(OPT_fcf_protection_EQ)) {
StringRef Name = A->getValue();
if (Name == "full") {
@@ -1138,8 +993,6 @@
}
}
- Opts.DebugCompilationDir =
- std::string(Args.getLastArgValue(OPT_fdebug_compilation_dir));
for (auto *A :
Args.filtered(OPT_mlink_bitcode_file, OPT_mlink_builtin_bitcode)) {
CodeGenOptions::BitcodeFileToLink F;
@@ -1153,45 +1006,10 @@
}
Opts.LinkBitcodeFiles.push_back(F);
}
- Opts.SanitizeCoverageType =
- getLastArgIntValue(Args, OPT_fsanitize_coverage_type, 0, Diags);
Opts.SanitizeCoverageAllowlistFiles =
Args.getAllArgValues(OPT_fsanitize_coverage_allowlist);
Opts.SanitizeCoverageBlocklistFiles =
Args.getAllArgValues(OPT_fsanitize_coverage_blocklist);
- Opts.SanitizeMemoryTrackOrigins =
- getLastArgIntValue(Args, OPT_fsanitize_memory_track_origins_EQ, 0, Diags);
- Opts.SSPBufferSize =
- getLastArgIntValue(Args, OPT_stack_protector_buffer_size, 8, Diags);
- if (Arg *A = Args.getLastArg(OPT_mstack_alignment)) {
- StringRef Val = A->getValue();
- unsigned StackAlignment = Opts.StackAlignment;
- Val.getAsInteger(10, StackAlignment);
- Opts.StackAlignment = StackAlignment;
- }
-
- if (Arg *A = Args.getLastArg(OPT_mstack_probe_size)) {
- StringRef Val = A->getValue();
- unsigned StackProbeSize = Opts.StackProbeSize;
- Val.getAsInteger(0, StackProbeSize);
- Opts.StackProbeSize = StackProbeSize;
- }
-
- if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
- StringRef Name = A->getValue();
- unsigned Method = llvm::StringSwitch<unsigned>(Name)
- .Case("legacy", CodeGenOptions::Legacy)
- .Case("non-legacy", CodeGenOptions::NonLegacy)
- .Case("mixed", CodeGenOptions::Mixed)
- .Default(~0U);
- if (Method == ~0U) {
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
- Success = false;
- } else {
- Opts.setObjCDispatchMethod(
- static_cast<CodeGenOptions::ObjCDispatchMethodKind>(Method));
- }
- }
if (Args.getLastArg(OPT_femulated_tls) ||
Args.getLastArg(OPT_fno_emulated_tls)) {
@@ -1200,24 +1018,6 @@
Args.hasFlag(OPT_femulated_tls, OPT_fno_emulated_tls, false);
}
- if (Arg *A = Args.getLastArg(OPT_ftlsmodel_EQ)) {
- StringRef Name = A->getValue();
- unsigned Model = llvm::StringSwitch<unsigned>(Name)
- .Case("global-dynamic", CodeGenOptions::GeneralDynamicTLSModel)
- .Case("local-dynamic", CodeGenOptions::LocalDynamicTLSModel)
- .Case("initial-exec", CodeGenOptions::InitialExecTLSModel)
- .Case("local-exec", CodeGenOptions::LocalExecTLSModel)
- .Default(~0U);
- if (Model == ~0U) {
- Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
- Success = false;
- } else {
- Opts.setDefaultTLSModel(static_cast<CodeGenOptions::TLSModel>(Model));
- }
- }
-
- Opts.TLSSize = getLastArgIntValue(Args, OPT_mtls_size_EQ, 0, Diags);
-
if (Arg *A = Args.getLastArg(OPT_fdenormal_fp_math_EQ)) {
StringRef Val = A->getValue();
Opts.FPDenormalMode = llvm::parseDenormalFPAttribute(Val);
@@ -1258,7 +1058,6 @@
Opts.LinkerOptions = Args.getAllArgValues(OPT_linker_option);
bool NeedLocTracking = false;
- Opts.OptRecordFile = std::string(Args.getLastArgValue(OPT_opt_record_file));
if (!Opts.OptRecordFile.empty())
NeedLocTracking = true;
@@ -1300,8 +1099,6 @@
Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo)
<< "-fdiagnostics-show-hotness";
- Opts.DiagnosticsHotnessThreshold = getLastArgUInt64Value(
- Args, options::OPT_fdiagnostics_hotness_threshold_EQ, 0);
if (Opts.DiagnosticsHotnessThreshold > 0 && !UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo)
<< "-fdiagnostics-hotness-threshold=";
@@ -1328,19 +1125,10 @@
Args.getAllArgValues(OPT_fsanitize_trap_EQ), Diags,
Opts.SanitizeTrap);
- Opts.CudaGpuBinaryFileName =
- std::string(Args.getLastArgValue(OPT_fcuda_include_gpubinary));
-
- Opts.EmitCheckPathComponentsToStrip = getLastArgIntValue(
- Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags);
-
Opts.DefaultFunctionAttrs = Args.getAllArgValues(OPT_default_function_attr);
Opts.PassPlugins = Args.getAllArgValues(OPT_fpass_plugin_EQ);
- Opts.SymbolPartition =
- std::string(Args.getLastArgValue(OPT_fsymbol_partition_EQ));
-
return Success;
}
@@ -3319,7 +3107,7 @@
Res.getCodeGenOpts().Argv0 = Argv0;
Res.getCodeGenOpts().CommandLineArgs = CommandLineArgs;
- FixupInvocation(Res, Diags);
+ FixupInvocation(Args, Res, Diags);
return Success;
}
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -699,6 +699,19 @@
Group<f_clang_Group>, HelpText<"Enable sanitizer statistics gathering.">,
MarshallingInfoFlag<"CodeGenOpts.SanitizeStats", "false">;
+def fsanitize_memory_track_origins_EQ : Joined<["-"], "fsanitize-memory-track-origins=">,
+ Group<f_clang_Group>, HelpText<"Enable origins tracking in MemorySanitizer">,
+ MarshallingInfoStringInt<"CodeGenOpts.SanitizeMemoryTrackOrigins">;
+def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-undefined-strip-path-components=">,
+ Group<f_clang_Group>, MetaVarName<"<number>">,
+ HelpText<"Strip (or keep only, if negative) a given number of path components "
+ "when emitting check metadata.">,
+ MarshallingInfoStringInt<"CodeGenOpts.EmitCheckPathComponentsToStrip", "0", "int">;
+def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
+ Group<f_Group>,
+ HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
+ MarshallingInfoString<"CodeGenOpts.ThinLinkBitcodeFile">;
+
} // Flags = [CC1Option, CoreOption]
def fstrict_float_cast_overflow : Flag<["-"], "fstrict-float-cast-overflow">, Group<f_Group>,
@@ -878,6 +891,77 @@
MarshallingInfoFlag<"CodeGenOpts.InstrumentForProfiling", "false">;
defm integrated_as : OptOutFFlag<"integrated-as", "Enable", "Disable", " the integrated assembler", [], "CodeGenOpts.DisableIntegratedAS">;
+def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
+ Group<f_Group>, Flags<[DriverOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
+ HelpText<"Embed LLVM bitcode (option: off, all, bitcode, marker)">, Values<"off,all,bitcode,marker">,
+ NormalizedValuesScope<"CodeGenOptions">,
+ MarshallingInfoString<"CodeGenOpts.EmbedBitcode", "Embed_Off">,
+ NormalizedValues<["Embed_Off", "Embed_All", "Embed_Bitcode", "Embed_Marker"]>, AutoNormalizeEnum;
+def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
+ Group<f_Group>, Flags<[DriverOption, CC1Option]>,
+ HelpText<"Enable sample-based profile guided optimizations">,
+ MarshallingInfoString<"CodeGenOpts.SampleProfileFile">;
+def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
+ Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
+ HelpText<"The compilation directory to embed in the debug info.">,
+ MarshallingInfoString<"CodeGenOpts.DebugCompilationDir">;
+def fprofile_remapping_file_EQ : Joined<["-"], "fprofile-remapping-file=">,
+ Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<file>">,
+ HelpText<"Use the remappings described in <file> to match the profile data against names in the program">,
+ MarshallingInfoString<"CodeGenOpts.ProfileRemappingFile">;
+def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">,
+ Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<number>">,
+ HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count">,
+ MarshallingInfoStringInt<"CodeGenOpts.DiagnosticsHotnessThreshold">;
+def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
+ Flags<[CC1Option]>,
+ MarshallingInfoString<"CodeGenOpts.SymbolPartition">;
+def fxray_instruction_threshold_EQ :
+ JoinedOrSeparate<["-"], "fxray-instruction-threshold=">,
+ Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Sets the minimum function size to instrument with XRay">,
+ MarshallingInfoStringInt<"CodeGenOpts.XRayInstructionThreshold", "200">;
+def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Use the given vector functions library">, Values<"Accelerate,MASSV,SVML,none">,
+ MarshallingInfoString<"CodeGenOpts.VecLib", "NoLibrary">,
+ NormalizedValuesScope<"CodeGenOptions">,
+ NormalizedValues<["Accelerate", "MASSV", "SVML", "NoLibrary"]>,
+ AutoNormalizeEnum;
+def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<N,M>">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">,
+ MarshallingInfoStringInt<"CodeGenOpts.PatchableFunctionEntryCount">;
+def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>, Flags<[CC1Option]>,
+ Values<"global-dynamic,local-dynamic,initial-exec,local-exec">,
+ NormalizedValuesScope<"CodeGenOptions">,
+ MarshallingInfoString<"CodeGenOpts.DefaultTLSModel", "GeneralDynamicTLSModel">,
+ NormalizedValues<["GeneralDynamicTLSModel", "LocalDynamicTLSModel", "InitialExecTLSModel", "LocalExecTLSModel"]>,
+ AutoNormalizeEnum;
+def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Issue call to specified function rather than a trap instruction">,
+ MarshallingInfoString<"CodeGenOpts.TrapFuncName">;
+def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
+ Flags<[CC1Option, CC1AsOption]>,
+ HelpText<"Place each function's basic blocks in unique sections (ELF Only) : all | labels | none | list=<file>">,
+ DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>,
+ Values<"all,labels,none,list=">,
+ MarshallingInfoString<"CodeGenOpts.BBSections", [{std::string("none")}]>;
+def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[DriverOption, CC1Option]>,
+ HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
+ "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
+ MarshallingInfoStringInt<"CodeGenOpts.TLSSize">;
+def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>, Flags<[CC1Option]>,
+ HelpText<"Set the stack alignment">,
+ MarshallingInfoStringInt<"CodeGenOpts.StackAlignment">;
+def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>, Flags<[CC1Option]>,
+ HelpText<"Set the stack probe size">,
+ MarshallingInfoStringInt<"CodeGenOpts.StackProbeSize", "4096">;
+def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>, Flags<[CC1Option]>,
+ HelpText<"The thread model to use, e.g. posix, single (posix by default)">, Values<"posix,single">,
+ MarshallingInfoString<"CodeGenOpts.ThreadModel", [{std::string("posix")}]>;
+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">;
+
let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
def debug_info_macro : Flag<["-"], "debug-info-macro">,
@@ -900,12 +984,38 @@
"Note this may change .s semantics and shouldn't generally be used "
"on compiler-generated code.">,
MarshallingInfoFlag<"CodeGenOpts.SaveTempLabels", "false">;
+
def mrelocation_model : Separate<["-"], "mrelocation-model">,
HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">,
NormalizedValuesScope<"llvm::Reloc">,
NormalizedValues<["Static", "PIC_", "ROPI", "RWPI", "ROPI_RWPI", "DynamicNoPIC"]>,
MarshallingInfoString<"CodeGenOpts.RelocationModel", "PIC_">,
AutoNormalizeEnum;
+def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">,
+ Values<"line-tables-only,line-directives-only,constructor,limited,standalone">,
+ NormalizedValuesScope<"codegenoptions">,
+ MarshallingInfoString<"CodeGenOpts.DebugInfo", "NoDebugInfo">,
+ NormalizedValues<["DebugLineTablesOnly", "DebugDirectivesOnly", "DebugInfoConstructor", "LimitedDebugInfo", "FullDebugInfo"]>,
+ AutoNormalizeEnum;
+def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
+ MarshallingInfoStringInt<"CodeGenOpts.DwarfVersion">;
+def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">,
+ Values<"gdb,lldb,sce">,
+ NormalizedValuesScope<"llvm::DebuggerKind">,
+ MarshallingInfoString<"CodeGenOpts.DebuggerTuning", "Default">,
+ NormalizedValues<["GDB", "LLDB", "SCE"]>, AutoNormalizeEnum;
+def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
+ HelpText<"The string to embed in the Dwarf debug flags record.">,
+ MarshallingInfoString<"CodeGenOpts.DwarfDebugFlags">;
+def record_command_line : Separate<["-"], "record-command-line">,
+ HelpText<"The string to embed in the .LLVM.command.line section.">,
+ MarshallingInfoString<"CodeGenOpts.RecordCommandLine">;
+def main_file_name : Separate<["-"], "main-file-name">,
+ HelpText<"Main file name to use for debug info and source if missing">,
+ MarshallingInfoString<"CodeGenOpts.MainFileName">;
+def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
+ HelpText<"File name to use for split dwarf debug info output">,
+ MarshallingInfoString<"CodeGenOpts.SplitDwarfOutput">;
} // Flags = [CC1Option, CC1AsOption, NoDriverOption]
@@ -1069,6 +1179,66 @@
HelpText<"Preserve 3-component vector type">,
MarshallingInfoFlag<"CodeGenOpts.PreserveVec3Type", "false">;
+def fcuda_include_gpubinary : Separate<["-"], "fcuda-include-gpubinary">,
+ HelpText<"Incorporate CUDA device-side binary into host object file.">,
+ MarshallingInfoString<"CodeGenOpts.CudaGpuBinaryFileName">;
+def mdebug_pass : Separate<["-"], "mdebug-pass">,
+ HelpText<"Enable additional debug output">,
+ MarshallingInfoString<"CodeGenOpts.DebugPass">;
+def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">,
+ HelpText<"Specify which frame pointers to retain (all, non-leaf, none).">, Values<"all,non-leaf,none">,
+ NormalizedValuesScope<"CodeGenOptions::FramePointerKind">,
+ MarshallingInfoString<"CodeGenOpts.FramePointer", "None">,
+ NormalizedValues<["All", "NonLeaf", "None"]>, AutoNormalizeEnum;
+def mfloat_abi : Separate<["-"], "mfloat-abi">,
+ HelpText<"The float ABI to use">,
+ MarshallingInfoString<"CodeGenOpts.FloatABI">;
+def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
+ HelpText<"Limit float precision to the given value">,
+ MarshallingInfoString<"CodeGenOpts.LimitFloatPrecision">;
+def mregparm : Separate<["-"], "mregparm">,
+ HelpText<"Limit the number of registers available for integer arguments">,
+ MarshallingInfoStringInt<"CodeGenOpts.NumRegisterParameters">;
+def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
+ HelpText<"Put global and static data smaller than the limit into a special section">,
+ MarshallingInfoStringInt<"CodeGenOpts.SmallDataLimit">;
+def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
+ HelpText<"Sanitizer coverage type">,
+ MarshallingInfoStringInt<"CodeGenOpts.SanitizeCoverageType">;
+def fpatchable_function_entry_offset_EQ
+ : Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"<M>">,
+ HelpText<"Generate M NOPs before function entry">,
+ MarshallingInfoStringInt<"CodeGenOpts.PatchableFunctionEntryOffset">;
+def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
+ HelpText<"Enable PGO instrumentation. The accepted value is clang, llvm, "
+ "or none">, Values<"none,clang,llvm,csllvm">,
+ NormalizedValuesScope<"CodeGenOptions">,
+ MarshallingInfoString<"CodeGenOpts.ProfileInstr", "ProfileNone">,
+ NormalizedValues<["ProfileNone", "ProfileClangInstr", "ProfileIRInstr", "ProfileCSIRInstr"]>,
+ AutoNormalizeEnum;
+def fprofile_instrument_path_EQ : Joined<["-"], "fprofile-instrument-path=">,
+ HelpText<"Generate instrumented code to collect execution counts into "
+ "<file> (overridden by LLVM_PROFILE_FILE env var)">,
+ MarshallingInfoString<"CodeGenOpts.InstrProfileOutput">;
+def fprofile_instrument_use_path_EQ :
+ Joined<["-"], "fprofile-instrument-use-path=">,
+ HelpText<"Specify the profile path in PGO use compilation">,
+ MarshallingInfoString<"CodeGenOpts.ProfileInstrumentUsePath">;
+def opt_record_file : Separate<["-"], "opt-record-file">,
+ HelpText<"File name to use for YAML optimization record output">,
+ MarshallingInfoString<"CodeGenOpts.OptRecordFile">;
+def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
+ HelpText<"Name of the split dwarf debug info file to encode in the object file">,
+ MarshallingInfoString<"CodeGenOpts.SplitDwarfFile">;
+def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,
+ HelpText<"Objective-C dispatch method to use">, Values<"legacy,non-legacy,mixed">,
+ NormalizedValuesScope<"CodeGenOptions">,
+ MarshallingInfoString<"CodeGenOpts.ObjCDispatchMethod", "Legacy">,
+ NormalizedValues<["Legacy", "NonLegacy", "Mixed"]>, AutoNormalizeEnum;
+def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
+ HelpText<"Lower bound for a buffer to be considered for stack protection">,
+ MarshallingInfoStringInt<"CodeGenOpts.SSPBufferSize", "8">;
+
} // Flags = [CC1Option, NoDriverOption]
// HeaderSearch Options
@@ -1449,8 +1619,6 @@
def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
HelpText<"Generate code for CUDA device">,
MarshallingInfoFlag<"LangOpts->CUDAIsDevice", "false">;
-def fcuda_include_gpubinary : Separate<["-"], "fcuda-include-gpubinary">,
- HelpText<"Incorporate CUDA device-side binary into host object file.">;
def fcuda_allow_variadic_functions : Flag<["-"], "fcuda-allow-variadic-functions">,
HelpText<"Allow variadic functions in CUDA device code.">,
MarshallingInfoFlag<"LangOpts->CUDAAllowVariadicFunctions", "false">;
@@ -1833,9 +2001,6 @@
// C++ Coroutines TS
defm coroutines_ts : OptInFFlag<"coroutines-ts", "Enable support for the C++ Coroutines TS">;
-def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
- Group<f_Group>, Flags<[DriverOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
- HelpText<"Embed LLVM bitcode (option: off, all, bitcode, marker)">;
def fembed_bitcode : Flag<["-"], "fembed-bitcode">, Group<f_Group>,
Alias<fembed_bitcode_EQ>, AliasArgs<["all"]>,
HelpText<"Embed LLVM IR bitcode as data">;
@@ -1847,9 +2012,6 @@
Flags<[CoreOption]>;
def fno_profile_sample_use : Flag<["-"], "fno-profile-sample-use">, Group<f_Group>,
Flags<[CoreOption]>;
-def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
- Group<f_Group>, Flags<[DriverOption, CC1Option]>,
- HelpText<"Enable sample-based profile guided optimizations">;
def fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">,
Group<f_Group>, Flags<[DriverOption]>;
def fauto_profile : Flag<["-"], "fauto-profile">, Group<f_Group>,
@@ -1862,9 +2024,6 @@
Group<f_Group>, Alias<fprofile_sample_accurate>;
def fno_auto_profile_accurate : Flag<["-"], "fno-auto-profile-accurate">,
Group<f_Group>, Alias<fno_profile_sample_accurate>;
-def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
- Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
- HelpText<"The compilation directory to embed in the debug info.">;
def fdebug_compilation_dir_EQ : Joined<["-"], "fdebug-compilation-dir=">,
Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
Alias<fdebug_compilation_dir>;
@@ -1879,9 +2038,6 @@
def fprofile_instr_use_EQ : Joined<["-"], "fprofile-instr-use=">,
Group<f_Group>, Flags<[CoreOption]>,
HelpText<"Use instrumentation data for profile-guided optimization">;
-def fprofile_remapping_file_EQ : Joined<["-"], "fprofile-remapping-file=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<file>">,
- HelpText<"Use the remappings described in <file> to match the profile data against names in the program">;
def fprofile_remapping_file : Separate<["-"], "fprofile-remapping-file">,
Group<f_Group>, Flags<[CoreOption]>, Alias<fprofile_remapping_file_EQ>;
def fprofile_generate : Flag<["-"], "fprofile-generate">,
@@ -1972,9 +2128,6 @@
def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">,
Group<f_clang_Group>, Flags<[CC1Option]>,
HelpText<"Print source range spans in numeric form">;
-def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">,
- Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<number>">,
- HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count">;
def fdiagnostics_show_option : Flag<["-"], "fdiagnostics-show-option">, Group<f_Group>,
HelpText<"Print option name with mappable diagnostics">;
def fdiagnostics_show_note_include_stack : Flag<["-"], "fdiagnostics-show-note-include-stack">,
@@ -2023,8 +2176,6 @@
def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>;
def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>;
defm fixed_point : OptInFFlag<"fixed-point", "Enable", "Disable", " fixed point types">;
-def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
- Flags<[CC1Option]>;
// Begin sanitizer flags. These should all be core options exposed in all driver
// modes.
@@ -2066,9 +2217,6 @@
def : Joined<["-"], "fsanitize-coverage-blacklist=">,
Group<f_clang_Group>, Flags<[CoreOption, HelpHidden]>, Alias<fsanitize_coverage_blocklist>,
HelpText<"Deprecated, use -fsanitize-coverage-blocklist= instead">;
-def fsanitize_memory_track_origins_EQ : Joined<["-"], "fsanitize-memory-track-origins=">,
- Group<f_clang_Group>,
- HelpText<"Enable origins tracking in MemorySanitizer">;
def fsanitize_memory_track_origins : Flag<["-"], "fsanitize-memory-track-origins">,
Group<f_clang_Group>,
HelpText<"Enable origins tracking in MemorySanitizer">;
@@ -2161,10 +2309,6 @@
Group<f_clang_Group>,
Flags<[CoreOption, DriverOption]>,
HelpText<"Disable atomic operations instrumentation in ThreadSanitizer">;
-def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-undefined-strip-path-components=">,
- Group<f_clang_Group>, MetaVarName<"<number>">,
- HelpText<"Strip (or keep only, if negative) a given number of path components "
- "when emitting check metadata.">;
} // end -f[no-]sanitize* flags
@@ -2226,10 +2370,6 @@
Alias<fcf_protection_EQ>, AliasArgs<["full"]>,
HelpText<"Enable cf-protection in 'full' mode">;
-def fxray_instruction_threshold_EQ :
- JoinedOrSeparate<["-"], "fxray-instruction-threshold=">,
- Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Sets the minimum function size to instrument with XRay">;
def fxray_instruction_threshold_ :
JoinedOrSeparate<["-"], "fxray-instruction-threshold">,
Group<f_Group>, Flags<[CC1Option]>;
@@ -2284,9 +2424,6 @@
def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
Flags<[CoreOption, CC1Option]>, Group<f_Group>,
HelpText<"Perform ThinLTO importing using provided function summary index">;
-def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
- Flags<[CoreOption, CC1Option]>, Group<f_Group>,
- HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">;
def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
Group<f_Group>, Flags<[DriverOption, CoreOption]>;
def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>, Flags<[CC1Option]>,
@@ -2404,8 +2541,6 @@
HelpText<"Disables the global instruction selector">;
def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_Group>,
Alias<fno_global_isel>;
-def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Use the given vector functions library">, Values<"Accelerate,MASSV,SVML,none">;
def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
Alias<flax_vector_conversions_EQ>, AliasArgs<["none"]>;
def fno_modules : Flag <["-"], "fno-modules">, Group<f_Group>,
@@ -2530,8 +2665,6 @@
def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">;
def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group<f_Group>;
-def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>, Flags<[CC1Option]>,
- MetaVarName<"<N,M>">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">;
def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Override the default ABI to return all structs on the stack">;
def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group<f_Group>;
@@ -2654,15 +2787,12 @@
def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Group<f_Group>, Flags<[DriverOption]>;
def : Flag<["-"], "fterminated-vtables">, Alias<fapple_kext>;
-def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>, Flags<[CC1Option]>;
def ftrapv : Flag<["-"], "ftrapv">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Trap on integer overflow">;
def ftrapv_handler_EQ : Joined<["-"], "ftrapv-handler=">, Group<f_Group>,
MetaVarName<"<function name>">,
HelpText<"Specify the function to be called on overflow">;
def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group<f_Group>, Flags<[CC1Option]>;
-def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Issue call to specified function rather than a trap instruction">;
def funit_at_a_time : Flag<["-"], "funit-at-a-time">, Group<f_Group>;
def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
HelpText<"Turn on loop unroller">, Flags<[CC1Option]>;
@@ -2689,12 +2819,6 @@
def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Treat signed integer overflow as two's complement">;
defm function_sections : OptInFFlag<"function-sections", "Place each function in its own section">;
-def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
- Flags<[CC1Option, CC1AsOption]>,
- HelpText<"Place each function's basic blocks in unique sections (ELF Only) : all | labels | none | list=<file>">,
- DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>,
- Values<"all,labels,none,list=">;
-
def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
HelpText<"Place debug types in their own section (ELF Only)">;
@@ -2892,9 +3016,6 @@
def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias<mwatchos_simulator_version_min_EQ>;
def march_EQ : Joined<["-"], "march=">, Group<m_Group>, Flags<[CoreOption]>;
def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Flags<[DriverOption]>;
-def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[DriverOption, CC1Option]>,
- HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
- "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">;
def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>;
def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>;
def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>;
@@ -2939,14 +3060,8 @@
HelpText<"Disable function outlining (AArch64 only)">;
def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
-def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>, Flags<[CC1Option]>,
- HelpText<"Set the stack alignment">;
-def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>, Flags<[CC1Option]>,
- HelpText<"Set the stack probe size">;
def mstack_arg_probe : Flag<["-"], "mstack-arg-probe">, Group<m_Group>,
HelpText<"Enable stack probes">;
-def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>, Flags<[CC1Option]>,
- HelpText<"The thread model to use, e.g. posix, single (posix by default)">, Values<"posix,single">;
def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group<m_Group>;
def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>, Flags<[CC1Option]>,
HelpText<"Disable merging of globals">;
@@ -3195,8 +3310,6 @@
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 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.">;
def mno_pie_copy_relocations : Flag<["-"], "mno-pie-copy-relocations">, Group<m_Group>;
def mno_packed_stack : Flag<["-"], "mno-packed-stack">, Flags<[CC1Option]>, Group<m_Group>;
def mips16 : Flag<["-"], "mips16">, Group<m_mips_Features_Group>;
@@ -4267,19 +4380,11 @@
//===----------------------------------------------------------------------===//
let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
-def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
def default_function_attr : Separate<["-"], "default-function-attr">,
HelpText<"Apply given attribute to all functions">;
-def dwarf_version_EQ : Joined<["-"], "dwarf-version=">;
-def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">;
-def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
- HelpText<"The string to embed in the Dwarf debug flags record.">;
-def record_command_line : Separate<["-"], "record-command-line">,
- HelpText<"The string to embed in the .LLVM.command.line section.">;
def compress_debug_sections : Flag<["-", "--"], "compress-debug-sections">,
HelpText<"DWARF debug sections compression">;
-def compress_debug_sections_EQ : Joined<["-", "--"], "compress-debug-sections=">,
- HelpText<"DWARF debug sections compression type">;
+def compress_debug_sections_EQ : Joined<["-", "--"], "compress-debug-sections=">;
}
def coverage_data_file : Separate<["-"], "coverage-data-file">,
@@ -4294,20 +4399,8 @@
HelpText<"Four-byte version string for gcov files.">;
def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">,
HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">;
-def mdebug_pass : Separate<["-"], "mdebug-pass">,
- HelpText<"Enable additional debug output">;
-def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">,
- HelpText<"Specify which frame pointers to retain (all, non-leaf, none).">, Values<"all,non-leaf,none">;
-def mfloat_abi : Separate<["-"], "mfloat-abi">,
- HelpText<"The float ABI to use">;
def mtp : Separate<["-"], "mtp">,
HelpText<"Mode for reading thread pointer">;
-def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
- HelpText<"Limit float precision to the given value">;
-def mregparm : Separate<["-"], "mregparm">,
- HelpText<"Limit the number of registers available for integer arguments">;
-def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
- HelpText<"Put global and static data smaller than the limit into a special section">;
def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">,
HelpText<"Link the given bitcode file before performing optimizations.">;
def mlink_builtin_bitcode : Separate<["-"], "mlink-builtin-bitcode">,
@@ -4319,20 +4412,6 @@
HelpText<"Add dependent library">;
def linker_option : Joined<["--"], "linker-option=">,
HelpText<"Add linker option">;
-def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
- HelpText<"Sanitizer coverage type">;
-def fpatchable_function_entry_offset_EQ
- : Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"<M>">,
- HelpText<"Generate M NOPs before function entry">;
-def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
- HelpText<"Enable PGO instrumentation. The accepted value is clang, llvm, "
- "or none">, Values<"none,clang,llvm">;
-def fprofile_instrument_path_EQ : Joined<["-"], "fprofile-instrument-path=">,
- HelpText<"Generate instrumented code to collect execution counts into "
- "<file> (overridden by LLVM_PROFILE_FILE env var)">;
-def fprofile_instrument_use_path_EQ :
- Joined<["-"], "fprofile-instrument-use-path=">,
- HelpText<"Specify the profile path in PGO use compilation">;
// The driver option takes the key as a parameter to the -msign-return-address=
// and -mbranch-protection= options, but CC1 has a separate option so we
// don't have to parse the parameter twice.
@@ -4520,8 +4599,6 @@
HelpText<"Print the output of the dependency directives source minimizer">;
}
-def opt_record_file : Separate<["-"], "opt-record-file">,
- HelpText<"File name to use for YAML optimization record output">;
def opt_record_passes : Separate<["-"], "opt-record-passes">,
HelpText<"Only record remark information for passes whose names match the given regular expression">;
def opt_record_format : Separate<["-"], "opt-record-format">,
@@ -4543,17 +4620,6 @@
// Language Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
-
-def main_file_name : Separate<["-"], "main-file-name">,
- HelpText<"Main file name to use for debug info and source if missing">;
-def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
- HelpText<"File name to use for split dwarf debug info output">;
-
-}
-
-def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
- HelpText<"Name of the split dwarf debug info file to encode in the object file">;
def fno_wchar : Flag<["-"], "fno-wchar">,
HelpText<"Disable C++ builtin type wchar_t">;
def fconstant_string_class : Separate<["-"], "fconstant-string-class">,
@@ -4563,8 +4629,6 @@
HelpText<"Objective-C++ Automatic Reference Counting standard library kind">, Values<"libc++,libstdc++,none">;
def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,
HelpText<"The target Objective-C runtime supports ARC weak operations">;
-def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,
- HelpText<"Objective-C dispatch method to use">, Values<"legacy,non-legacy,mixed">;
def function_alignment : Separate<["-"], "function-alignment">,
HelpText<"default alignment for functions">;
def pic_level : Separate<["-"], "pic-level">,
@@ -4575,8 +4639,6 @@
Alias<error_on_deserialized_pch_decl>;
def stack_protector : Separate<["-"], "stack-protector">,
HelpText<"Enable stack protectors">;
-def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
- HelpText<"Lower bound for a buffer to be considered for stack protection">;
def fvisibility : Separate<["-"], "fvisibility">,
HelpText<"Default type and symbol visibility">;
def ftype_visibility : Separate<["-"], "ftype-visibility">,
Index: clang/include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -77,8 +77,6 @@
"invalid thread model '%0' in '%1' for this target">;
def err_drv_invalid_linker_name : Error<
"invalid linker name in argument '%0'">;
-def err_drv_invalid_pgo_instrumentor : Error<
- "invalid PGO instrumentor in argument '%0'">;
def err_drv_invalid_rtlib_name : Error<
"invalid runtime library name in argument '%0'">;
def err_drv_unsupported_rtlib_for_platform : Error<
Index: clang/include/clang/Basic/CodeGenOptions.h
===================================================================
--- clang/include/clang/Basic/CodeGenOptions.h
+++ clang/include/clang/Basic/CodeGenOptions.h
@@ -30,6 +30,8 @@
/// Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure
/// that this large collection of bitfields is a trivial class type.
class CodeGenOptionsBase {
+ friend class CompilerInvocation;
+
public:
#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits