[cfe-commits] r89508 - in /cfe/trunk: include/clang/Driver/CC1Options.td lib/Driver/CC1Options.cpp
Daniel Dunbar
daniel at zuster.org
Fri Nov 20 15:28:07 PST 2009
Author: ddunbar
Date: Fri Nov 20 17:28:07 2009
New Revision: 89508
URL: http://llvm.org/viewvc/llvm-project?rev=89508&view=rev
Log:
Driver: Add clang -cc1 dependency output options parsing.
Modified:
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/lib/Driver/CC1Options.cpp
Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=89508&r1=89507&r2=89508&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Fri Nov 20 17:28:07 2009
@@ -40,3 +40,12 @@
HelpText<"Disallow merging of constants.">;
def O : Joined<"-O">, HelpText<"Optimization level">;
def Os : Flag<"-Os">, HelpText<"Optimize for size">;
+
+// Dependency Output Options
+def dependency_file : Separate<"-dependency-file">,
+ HelpText<"Filename (or -) to write dependency output to">;
+def sys_header_deps : Flag<"-sys-header-deps">,
+ HelpText<"Include system headers in dependency output">;
+def MT : Separate<"-MT">, HelpText<"Specify target for dependency">;
+def MP : Flag<"-MP">,
+ HelpText<"Create phony target for each dependency (other than main file)">;
Modified: cfe/trunk/lib/Driver/CC1Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CC1Options.cpp?rev=89508&r1=89507&r2=89508&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/CC1Options.cpp (original)
+++ cfe/trunk/lib/Driver/CC1Options.cpp Fri Nov 20 17:28:07 2009
@@ -121,6 +121,14 @@
#endif
}
+static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
+ ArgList &Args) {
+ Opts.OutputFile = getLastArgValue(Args, cc1options::OPT_dependency_file);
+ Opts.Targets = getAllArgValues(Args, cc1options::OPT_MT);
+ Opts.IncludeSystemHeaders = Args.hasArg(cc1options::OPT_sys_header_deps);
+ Opts.UsePhonyTargets = Args.hasArg(cc1options::OPT_MP);
+}
+
static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) {
Opts.ABI = getLastArgValue(Args, cc1options::OPT_target_abi);
Opts.CPU = getLastArgValue(Args, cc1options::OPT_mcpu);
@@ -152,8 +160,7 @@
<< " value )\n";
}
- // FIXME: Disabled until the FIXMEs are resolved.
- if (0)
- ParseCodeGenArgs(Res.getCodeGenOpts(), *InputArgs);
+ ParseCodeGenArgs(Res.getCodeGenOpts(), *InputArgs);
+ ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), *InputArgs);
ParseTargetArgs(Res.getTargetOpts(), *InputArgs);
}
More information about the cfe-commits
mailing list