[PATCH] D84187: Port DependencyOutput string based options to new option parsing system
Daniel Grumberg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 20 10:03:19 PDT 2020
dang created this revision.
dang added a reviewer: Bigcheese.
Herald added subscribers: cfe-commits, dexonsmith.
Herald added a project: clang.
Depends on D84186 <https://reviews.llvm.org/D84186>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84187
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
@@ -1347,10 +1347,7 @@
static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
ArgList &Args) {
- Opts.OutputFile = std::string(Args.getLastArgValue(OPT_dependency_file));
Opts.Targets = Args.getAllArgValues(OPT_MT);
- Opts.HeaderIncludeOutputFile =
- std::string(Args.getLastArgValue(OPT_header_include_file));
if (Args.hasArg(OPT_show_includes)) {
// Writing both /showIncludes and preprocessor output to stdout
// would produce interleaved output, so use stderr for /showIncludes.
@@ -1362,9 +1359,6 @@
} else {
Opts.ShowIncludesDest = ShowIncludesDestination::None;
}
- Opts.DOTOutputFile = std::string(Args.getLastArgValue(OPT_dependency_dot));
- Opts.ModuleDependencyOutputDir =
- std::string(Args.getLastArgValue(OPT_module_dependency_dir));
// Add sanitizer blacklists as extra dependencies.
// They won't be discovered by the regular preprocessor, so
// we let make / ninja to know about this implicit dependency.
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -358,6 +358,16 @@
HelpText<"Create phony target for each dependency (other than main file)">,
MarshallingInfoFlag<"DependencyOutputOpts.UsePhonyTargets", "false">;
+def dependency_file : Separate<["-"], "dependency-file">, Flags<[CC1Option]>,
+ HelpText<"Filename (or -) to write dependency output to">,
+ MarshallingInfoString<"DependencyOutputOpts.OutputFile">;
+def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>,
+ HelpText<"Filename to write DOT-formatted header dependencies to">,
+ MarshallingInfoString<"DependencyOutputOpts.DOTOutputFile">;
+def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
+ Flags<[CC1Option]>, HelpText<"Directory to dump module dependencies to">,
+ MarshallingInfoString<"DependencyOutputOpts.ModuleDependencyOutputDir">;
+
let Flags = [CC1Option, NoDriverOption] in {
def sys_header_deps : Flag<["-"], "sys-header-deps">,
@@ -367,6 +377,10 @@
HelpText<"Include module files in dependency output">,
MarshallingInfoFlag<"DependencyOutputOpts.IncludeModuleFiles", "false">;
+def header_include_file : Separate<["-"], "header-include-file">,
+ HelpText<"Filename (or -) to write header include output to">,
+ MarshallingInfoString<"DependencyOutputOpts.HeaderIncludeOutputFile">;
+
} // Flags = [CC1Option, NoDriverOption]
// Diagnostic Options
@@ -1741,12 +1755,6 @@
def dM : Flag<["-"], "dM">, Group<d_Group>, Flags<[CC1Option]>,
HelpText<"Print macro definitions in -E mode instead of normal output">;
def dead__strip : Flag<["-"], "dead_strip">;
-def dependency_file : Separate<["-"], "dependency-file">, Flags<[CC1Option]>,
- HelpText<"Filename (or -) to write dependency output to">;
-def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>,
- HelpText<"Filename to write DOT-formatted header dependencies to">;
-def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
- Flags<[CC1Option]>, HelpText<"Directory to dump module dependencies to">;
def dumpmachine : Flag<["-"], "dumpmachine">;
def dumpspecs : Flag<["-"], "dumpspecs">, Flags<[Unsupported]>;
def dumpversion : Flag<["-"], "dumpversion">;
@@ -4322,8 +4330,6 @@
// Dependency Output Options
//===----------------------------------------------------------------------===//
-def header_include_file : Separate<["-"], "header-include-file">,
- HelpText<"Filename (or -) to write header include output to">;
def show_includes : Flag<["--"], "show-includes">,
HelpText<"Print cl.exe style /showIncludes to stdout">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84187.279293.patch
Type: text/x-patch
Size: 3977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200720/f0bb0b15/attachment-0001.bin>
More information about the cfe-commits
mailing list