[cfe-commits] r45345 - /cfe/trunk/Driver/ASTConsumers.cpp

Christopher Lamb christopher.lamb at gmail.com
Mon Dec 24 12:56:09 PST 2007


Author: clamb
Date: Mon Dec 24 14:56:07 2007
New Revision: 45345

URL: http://llvm.org/viewvc/llvm-project?rev=45345&view=rev
Log:
Better handing of stdin/stdout for -emit-llvm-bc

Modified:
    cfe/trunk/Driver/ASTConsumers.cpp

Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=45345&r1=45344&r2=45345&view=diff

==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Mon Dec 24 14:56:07 2007
@@ -644,14 +644,14 @@
   std::string FileName = OutputFile;
   
   std::ostream *Out;
-  if (!OutputFile.size()) {
+  if (OutputFile == "-" || InFile == "-")
+    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());
-  } else if (OutputFile == "-") {
-    Out = llvm::cout.stream();
   } else {
     Out = new std::ofstream(FileName.c_str());
   }





More information about the cfe-commits mailing list