diff options
author | Alexey Sotkin <alexey.sotkin@intel.com> | 2018-03-02 12:11:40 +0000 |
---|---|---|
committer | Alexey Sotkin <alexey.sotkin@intel.com> | 2018-03-02 12:11:40 +0000 |
commit | aba98fc92e9c2f915a2c7a54934126628d1bf6a9 (patch) | |
tree | cb72ee5babadb91cdb63391ec50bd0719e41fca0 /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | c879aa7eab48fe0a9290ea1a3c433aae7d7a3b71 (diff) | |
download | bcm5719-llvm-aba98fc92e9c2f915a2c7a54934126628d1bf6a9.tar.gz bcm5719-llvm-aba98fc92e9c2f915a2c7a54934126628d1bf6a9.zip |
Add possibility to specify output stream for CompilerInstance
Patch by: krisb
Reviewers: teemperor
Reviewed By: teemperor
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D43809
llvm-svn: 326566
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 13fa4a83308..ac2548e6a52 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -846,7 +846,10 @@ GetOutputStream(CompilerInstance &CI, StringRef InFile, BackendAction Action) { std::unique_ptr<ASTConsumer> CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { BackendAction BA = static_cast<BackendAction>(Act); - std::unique_ptr<raw_pwrite_stream> OS = GetOutputStream(CI, InFile, BA); + std::unique_ptr<raw_pwrite_stream> OS = CI.takeOutputStream(); + if (!OS) + OS = GetOutputStream(CI, InFile, BA); + if (BA != Backend_EmitNothing && !OS) return nullptr; |