Driver: Support -M and -MM.
- Not particularly elegant, but my hand is forced by gcc.
Also, tweak -ccc-print-bindings output.
llvm-svn: 68027
diff --git a/clang/tools/clang-cc/DependencyFile.cpp b/clang/tools/clang-cc/DependencyFile.cpp
index 518f167..2cfd464 100644
--- a/clang/tools/clang-cc/DependencyFile.cpp
+++ b/clang/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 =