]> granicus.if.org Git - clang/commitdiff
printing with an unspecified dest means to print to stdout.
authorChris Lattner <sabre@nondot.org>
Sun, 17 Aug 2008 07:09:08 +0000 (07:09 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 17 Aug 2008 07:09:08 +0000 (07:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54872 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/PrintPreprocessedOutput.cpp

index 2a363f8ee13859e09a2ab97336f7a0fa861e1e1e..b9030087bc556f20b185f4b91084450ffa874e33 100644 (file)
@@ -500,7 +500,7 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP,
   
   // Open the output buffer.
   std::string Err;
-  llvm::raw_fd_ostream OS(OutFile.c_str(), Err);
+  llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), Err);
   if (!Err.empty()) {
     fprintf(stderr, "%s\n", Err.c_str());
     exit(1);