mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 16:06:39 +08:00
Driver: M and MM should be grouped together, <rdar://problem/8744831>.
llvm-svn: 121284
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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.
|
||||
|
||||
3
clang/test/Driver/m_and_mm.c
Normal file
3
clang/test/Driver/m_and_mm.c
Normal file
@@ -0,0 +1,3 @@
|
||||
// RUN: %clang -### \
|
||||
// RUN: -M -MM %s 2> %t
|
||||
// RUN: grep '"-sys-header-deps"' %t | count 0
|
||||
Reference in New Issue
Block a user