[llvm-branch-commits] [cfe-branch] r121557 - in /cfe/branches/Apple/whitney: lib/Driver/Driver.cpp lib/Driver/Tools.cpp test/Driver/m_and_mm.c

Daniel Dunbar daniel at zuster.org
Fri Dec 10 13:38:00 PST 2010


Author: ddunbar
Date: Fri Dec 10 15:37:59 2010
New Revision: 121557

URL: http://llvm.org/viewvc/llvm-project?rev=121557&view=rev
Log:
Merge r121284:
--
Author: Daniel Dunbar <daniel at zuster.org>
Date:   Wed Dec 8 21:33:40 2010 +0000

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

Added:
    cfe/branches/Apple/whitney/test/Driver/m_and_mm.c
Modified:
    cfe/branches/Apple/whitney/lib/Driver/Driver.cpp
    cfe/branches/Apple/whitney/lib/Driver/Tools.cpp

Modified: cfe/branches/Apple/whitney/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Driver/Driver.cpp?rev=121557&r1=121556&r2=121557&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Driver/Driver.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Driver/Driver.cpp Fri Dec 10 15:37:59 2010
@@ -800,8 +800,7 @@
 
   // -{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 @@
   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());

Modified: cfe/branches/Apple/whitney/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Driver/Tools.cpp?rev=121557&r1=121556&r2=121557&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Driver/Tools.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Driver/Tools.cpp Fri Dec 10 15:37:59 2010
@@ -136,8 +136,7 @@
   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.

Added: cfe/branches/Apple/whitney/test/Driver/m_and_mm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/Driver/m_and_mm.c?rev=121557&view=auto
==============================================================================
--- cfe/branches/Apple/whitney/test/Driver/m_and_mm.c (added)
+++ cfe/branches/Apple/whitney/test/Driver/m_and_mm.c Fri Dec 10 15:37:59 2010
@@ -0,0 +1,3 @@
+// RUN: %clang -### \
+// RUN:   -M -MM %s 2> %t
+// RUN: grep '"-sys-header-deps"' %t | count 0





More information about the llvm-branch-commits mailing list