aboutsummaryrefslogtreecommitdiff
path: root/clang/Driver/ASTConsumers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Driver/ASTConsumers.cpp')
-rw-r--r--clang/Driver/ASTConsumers.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/Driver/ASTConsumers.cpp b/clang/Driver/ASTConsumers.cpp
index df9d2e4..f3b595f 100644
--- a/clang/Driver/ASTConsumers.cpp
+++ b/clang/Driver/ASTConsumers.cpp
@@ -644,14 +644,18 @@ ASTConsumer *clang::CreateBCWriter(const std::string& InFile,
std::string FileName = OutputFile;
std::ostream *Out;
- if (OutputFile == "-" || InFile == "-")
+ if (OutputFile == "-")
Out = llvm::cout.stream();
else if (!OutputFile.size()) {
- llvm::sys::Path Path(InFile);
- Path.eraseSuffix();
- Path.appendSuffix("bc");
- FileName = Path.toString();
- Out = new std::ofstream(FileName.c_str());
+ if (InFile == "-")
+ Out = llvm::cout.stream();
+ else {
+ llvm::sys::Path Path(InFile);
+ Path.eraseSuffix();
+ Path.appendSuffix("bc");
+ FileName = Path.toString();
+ Out = new std::ofstream(FileName.c_str());
+ }
} else {
Out = new std::ofstream(FileName.c_str());
}