[cfe-commits] r106039 - /cfe/trunk/lib/Driver/Driver.cpp

Daniel Dunbar daniel at zuster.org
Tue Jun 15 13:30:18 PDT 2010


Author: ddunbar
Date: Tue Jun 15 15:30:18 2010
New Revision: 106039

URL: http://llvm.org/viewvc/llvm-project?rev=106039&view=rev
Log:
Driver: Support -Wp,-MMD,FOO, which I found an instance of. :(

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=106039&r1=106038&r2=106039&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Jun 15 15:30:18 2010
@@ -143,9 +143,13 @@
     // 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;





More information about the cfe-commits mailing list