summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-cc/DependencyFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/clang-cc/DependencyFile.cpp')
-rw-r--r--clang/tools/clang-cc/DependencyFile.cpp14
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 =
OpenPOWER on IntegriCloud