]> granicus.if.org Git - clang/commitdiff
Driver: Support -Wp,-MMD,FOO, which I found an instance of. :(
authorDaniel Dunbar <daniel@zuster.org>
Tue, 15 Jun 2010 20:30:18 +0000 (20:30 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 15 Jun 2010 20:30:18 +0000 (20:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106039 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index 0da26b70e00d3e092519bbf8025363d9e1ba9b02..0dbe39c28212452c627863bced581cb14a3c67f6 100644 (file)
@@ -143,9 +143,13 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
     // care to encourage this usage model.
     if (A->getOption().matches(options::OPT_Wp_COMMA) &&
         A->getNumValues() == 2 &&
-        A->getValue(Args, 0) == llvm::StringRef("-MD")) {
-      // Rewrite to -MD along with -MF.
-      DAL->AddFlagArg(A, Opts->getOption(options::OPT_MD));
+        (A->getValue(Args, 0) == llvm::StringRef("-MD") ||
+         A->getValue(Args, 0) == llvm::StringRef("-MMD"))) {
+      // Rewrite to -MD/-MMD along with -MF.
+      if (A->getValue(Args, 0) == llvm::StringRef("-MD"))
+        DAL->AddFlagArg(A, Opts->getOption(options::OPT_MD));
+      else
+        DAL->AddFlagArg(A, Opts->getOption(options::OPT_MMD));
       DAL->AddSeparateArg(A, Opts->getOption(options::OPT_MF),
                           A->getValue(Args, 1));
       continue;