diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-03-30 06:36:42 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-30 06:36:42 +0000 |
| commit | d67a32252c736d496ed12f173a81303f77b44e1a (patch) | |
| tree | 997bf810c264956df04e2bd1ccc91b4bdd52ef07 /clang/tools/clang-cc/DependencyFile.cpp | |
| parent | a01a5638139e6c4d3622db86e3395a81bf601b00 (diff) | |
| download | bcm5719-llvm-d67a32252c736d496ed12f173a81303f77b44e1a.tar.gz bcm5719-llvm-d67a32252c736d496ed12f173a81303f77b44e1a.zip | |
Driver: Support -M and -MM.
- Not particularly elegant, but my hand is forced by gcc.
Also, tweak -ccc-print-bindings output.
llvm-svn: 68027
Diffstat (limited to 'clang/tools/clang-cc/DependencyFile.cpp')
| -rw-r--r-- | clang/tools/clang-cc/DependencyFile.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/tools/clang-cc/DependencyFile.cpp b/clang/tools/clang-cc/DependencyFile.cpp index 518f1673057..2cfd4645d12 100644 --- a/clang/tools/clang-cc/DependencyFile.cpp +++ b/clang/tools/clang-cc/DependencyFile.cpp @@ -91,11 +91,15 @@ bool clang::CreateDependencyFileGen(Preprocessor *PP, } 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 = |

