Driver: M and MM should be grouped together, <rdar://problem/8744831>.

llvm-svn: 121284
This commit is contained in:
Daniel Dunbar
2010-12-08 21:33:40 +00:00
parent 310916a22d
commit 86aed7d5fc
3 changed files with 6 additions and 5 deletions

View File

@@ -800,8 +800,7 @@ void Driver::BuildActions(const ToolChain &TC, const ArgList &Args,
// -{E,M,MM} only run the preprocessor.
if ((FinalPhaseArg = Args.getLastArg(options::OPT_E)) ||
(FinalPhaseArg = Args.getLastArg(options::OPT_M)) ||
(FinalPhaseArg = Args.getLastArg(options::OPT_MM))) {
(FinalPhaseArg = Args.getLastArg(options::OPT_M, options::OPT_MM))) {
FinalPhase = phases::Preprocess;
// -{fsyntax-only,-analyze,emit-ast,S} only run up to the compiler.
@@ -909,7 +908,7 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
case phases::Preprocess: {
types::ID OutputTy;
// -{M, MM} alter the output type.
if (Args.hasArg(options::OPT_M) || Args.hasArg(options::OPT_MM)) {
if (Args.hasArg(options::OPT_M, options::OPT_MM)) {
OutputTy = types::TY_Dependencies;
} else {
OutputTy = types::getPreprocessedType(Input->getType());

View File

@@ -136,8 +136,7 @@ void Clang::AddPreprocessingOptions(const Driver &D,
Args.AddLastArg(CmdArgs, options::OPT_CC);
// Handle dependency file generation.
if ((A = Args.getLastArg(options::OPT_M)) ||
(A = Args.getLastArg(options::OPT_MM)) ||
if ((A = Args.getLastArg(options::OPT_M, options::OPT_MM)) ||
(A = Args.getLastArg(options::OPT_MD)) ||
(A = Args.getLastArg(options::OPT_MMD))) {
// Determine the output location.

View File

@@ -0,0 +1,3 @@
// RUN: %clang -### \
// RUN: -M -MM %s 2> %t
// RUN: grep '"-sys-header-deps"' %t | count 0