Created
March 20, 2009 19:30
-
-
Save pieter/82530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp | |
index 9a3930c..cb71b53 100644 | |
--- a/lib/Driver/Tools.cpp | |
+++ b/lib/Driver/Tools.cpp | |
@@ -40,7 +40,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | |
assert(JA.getType() == types::TY_Plist && "Invalid output type."); | |
CmdArgs.push_back("-analyze"); | |
} else if (isa<PreprocessJobAction>(JA)) { | |
- CmdArgs.push_back("-E"); | |
+ if (!Args.hasArg(options::OPT_M)) | |
+ CmdArgs.push_back("-E"); | |
} else if (isa<PrecompileJobAction>(JA)) { | |
// No special option needed, driven by -x. | |
// | |
@@ -228,15 +229,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | |
// FIXME: Add --stack-protector-buffer-size=<xxx> on | |
// -fstack-protect. | |
+ Args.AddLastArg(CmdArgs, options::OPT_M); | |
Args.AddLastArg(CmdArgs, options::OPT_MD); | |
Args.AddLastArg(CmdArgs, options::OPT_MM); | |
Args.AddAllArgs(CmdArgs, options::OPT_MF); | |
Args.AddLastArg(CmdArgs, options::OPT_MP); | |
Args.AddAllArgs(CmdArgs, options::OPT_MT); | |
- Arg *Unsupported = Args.getLastArg(options::OPT_M); | |
- if (!Unsupported) | |
- Unsupported = Args.getLastArg(options::OPT_MM); | |
+ Arg *Unsupported = Args.getLastArg(options::OPT_MM); | |
if (!Unsupported) | |
Unsupported = Args.getLastArg(options::OPT_MG); | |
if (!Unsupported) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment