jansvoboda11 updated this revision to Diff 311865.
jansvoboda11 added a comment.
Rebase, undo unnecessary move of options
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84190/new/
https://reviews.llvm.org/D84190
Files:
clang/include/clang/Driver/Options.td
clang/lib/Frontend/CompilerInvocation.cpp
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -2084,15 +2084,11 @@
<< A->getAsString(Args) << A->getValue();
}
- Opts.OutputFile = std::string(Args.getLastArgValue(OPT_o));
Opts.Plugins = Args.getAllArgValues(OPT_load);
- Opts.TimeTraceGranularity = getLastArgIntValue(
- Args, OPT_ftime_trace_granularity_EQ, Opts.TimeTraceGranularity, Diags);
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);
- Opts.ASTDumpFilter = std::string(Args.getLastArgValue(OPT_ast_dump_filter));
Opts.ModuleMapFiles = Args.getAllArgValues(OPT_fmodule_map_file);
// Only the -fmodule-file=<file> form.
for (const auto *A : Args.filtered(OPT_fmodule_file)) {
@@ -2107,22 +2103,10 @@
Diags.Report(diag::err_drv_argument_only_allowed_with) << "-fsystem-module"
<< "-emit-module";
- Opts.OverrideRecordLayoutsFile =
- std::string(Args.getLastArgValue(OPT_foverride_record_layout_EQ));
- Opts.AuxTriple = std::string(Args.getLastArgValue(OPT_aux_triple));
if (Args.hasArg(OPT_aux_target_cpu))
Opts.AuxTargetCPU = std::string(Args.getLastArgValue(OPT_aux_target_cpu));
if (Args.hasArg(OPT_aux_target_feature))
Opts.AuxTargetFeatures = Args.getAllArgValues(OPT_aux_target_feature);
- Opts.StatsFile = std::string(Args.getLastArgValue(OPT_stats_file));
-
- Opts.MTMigrateDir =
- std::string(Args.getLastArgValue(OPT_mt_migrate_directory));
- Opts.ARCMTMigrateReportOut =
- std::string(Args.getLastArgValue(OPT_arcmt_migrate_report_output));
-
- Opts.ObjCMTWhiteListPath =
- std::string(Args.getLastArgValue(OPT_objcmt_whitelist_dir_path));
if (Opts.ARCMTAction != FrontendOptions::ARCMT_None &&
Opts.ObjCMTAction != FrontendOptions::ObjCMT_None) {
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -557,7 +557,8 @@
def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt,
HelpText<"Apply modifications and produces temporary files that conform to ARC">;
def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">,
- HelpText<"Output path for the plist report">, Flags<[CC1Option]>;
+ HelpText<"Output path for the plist report">, Flags<[CC1Option]>,
+ MarshallingInfoString<"FrontendOpts.ARCMTMigrateReportOut">;
def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">,
HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>,
MarshallingInfoFlag<"FrontendOpts.ARCMTMigrateEmitARCErrors">;
@@ -620,7 +621,8 @@
MarshallingInfoBitfieldFlag<"FrontendOpts.ObjCMTAction", "FrontendOptions::ObjCMT_DesignatedInitializer">;
def objcmt_whitelist_dir_path: Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>,
- HelpText<"Only modify files with a filename contained in the provided directory path">;
+ HelpText<"Only modify files with a filename contained in the provided directory path">,
+ MarshallingInfoString<"FrontendOpts.ObjCMTWhiteListPath">;
// The misspelt "white-list" [sic] alias is due for removal.
def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>,
Alias<objcmt_whitelist_dir_path>;
@@ -2273,7 +2275,8 @@
MarshallingInfoFlag<"FrontendOpts.TimeTrace">;
def ftime_trace_granularity_EQ : Joined<["-"], "ftime-trace-granularity=">, Group<f_Group>,
HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
- Flags<[CC1Option, CoreOption]>;
+ Flags<[CC1Option, CoreOption]>,
+ MarshallingInfoStringInt<"FrontendOpts.TimeTraceGranularity", "500u">;
def fproc_stat_report : Joined<["-"], "fproc-stat-report">, Group<f_Group>,
HelpText<"Print subprocess statistics">;
def fproc_stat_report_EQ : Joined<["-"], "fproc-stat-report=">, Group<f_Group>,
@@ -3176,7 +3179,8 @@
def object : Flag<["-"], "object">;
def o : JoinedOrSeparate<["-"], "o">, Flags<[NoXarchOption, RenderAsInput,
CC1Option, CC1AsOption, FC1Option, FlangOption]>,
- HelpText<"Write output to <file>">, MetaVarName<"<file>">;
+ HelpText<"Write output to <file>">, MetaVarName<"<file>">,
+ MarshallingInfoString<"FrontendOpts.OutputFile">;
def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">;
def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>;
def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group<pedantic_Group>, Flags<[CC1Option]>;
@@ -4424,7 +4428,8 @@
def aux_target_feature : Separate<["-"], "aux-target-feature">,
HelpText<"Target specific auxiliary attributes">;
def aux_triple : Separate<["-"], "aux-triple">,
- HelpText<"Auxiliary target triple.">;
+ HelpText<"Auxiliary target triple.">,
+ MarshallingInfoString<"FrontendOpts.AuxTriple">;
def code_completion_at : Separate<["-"], "code-completion-at">,
MetaVarName<"<file>:<line>:<column>">,
HelpText<"Dump code-completion information at a location">;
@@ -4469,7 +4474,8 @@
MetaVarName<"<dump_filter>">,
HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
" nodes having a certain substring in a qualified name. Use"
- " -ast-list to list all filterable declaration node names.">;
+ " -ast-list to list all filterable declaration node names.">,
+ MarshallingInfoString<"FrontendOpts.ASTDumpFilter">;
def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
HelpText<"Do not automatically generate or update the global module index">,
MarshallingInfoFlag<"FrontendOpts.UseGlobalModuleIndex", "true">, IsNegative;
@@ -4603,7 +4609,8 @@
HelpText<"Don't preserve order of LLVM use-lists when serializing">;
def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
- HelpText<"Directory for temporary files produced during ARC or ObjC migration">;
+ HelpText<"Directory for temporary files produced during ARC or ObjC migration">,
+ MarshallingInfoString<"FrontendOpts.MTMigrateDir">;
def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Flags<[CC1Option, NoDriverOption]>,
HelpText<"The ARC migration action to take">, Values<"check,modify,migrate">,
@@ -4623,7 +4630,8 @@
HelpText<"Print performance metrics and statistics">,
MarshallingInfoFlag<"FrontendOpts.ShowStats">;
def stats_file : Joined<["-"], "stats-file=">,
- HelpText<"Filename to write statistics to">;
+ HelpText<"Filename to write statistics to">,
+ MarshallingInfoString<"FrontendOpts.StatsFile">;
def fdump_record_layouts : Flag<["-"], "fdump-record-layouts">,
HelpText<"Dump record layout information">;
def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">,
@@ -4642,7 +4650,8 @@
MarshallingInfoFlag<"FrontendOpts.FixToTemporaries">;
def foverride_record_layout_EQ : Joined<["-"], "foverride-record-layout=">,
- HelpText<"Override record layouts with those in the given file">;
+ HelpText<"Override record layouts with those in the given file">,
+ MarshallingInfoString<"FrontendOpts.OverrideRecordLayoutsFile">;
def pch_through_header_EQ : Joined<["-"], "pch-through-header=">,
HelpText<"Stop PCH generation after including this file. When using a PCH, "
"skip tokens until after this file is included.">;
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits