Driver: Support -M and -MM.
 - Not particularly elegant, but my hand is forced by gcc.

Also, tweak -ccc-print-bindings output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68027 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/DependencyFile.cpp b/tools/clang-cc/DependencyFile.cpp
index 518f167..2cfd464 100644
--- a/tools/clang-cc/DependencyFile.cpp
+++ b/tools/clang-cc/DependencyFile.cpp
@@ -91,11 +91,15 @@
   }
 
   std::string ErrMsg;
-  llvm::raw_ostream *OS =
-    new llvm::raw_fd_ostream(DependencyFile.c_str(), false, ErrStr);
-  if (!ErrMsg.empty()) {
-    ErrStr = "unable to open dependency file: " + ErrMsg;
-    return false;
+  llvm::raw_ostream *OS;
+  if (DependencyFile == "-") {
+    OS = new llvm::raw_stdout_ostream();
+  } else {
+    OS = new llvm::raw_fd_ostream(DependencyFile.c_str(), false, ErrStr);
+    if (!ErrMsg.empty()) {
+      ErrStr = "unable to open dependency file: " + ErrMsg;
+      return false;
+    }
   }
 
   DependencyFileCallback *PPDep =