[llvm-commits] CVS: llvm/tools/as/as.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat May 31 16:48:11 PDT 2003


Changes in directory llvm/tools/as:

as.cpp updated: 1.18 -> 1.19

---
Log message:

Add support for: -o -


---
Diffs of the changes:

Index: llvm/tools/as/as.cpp
diff -u llvm/tools/as/as.cpp:1.18 llvm/tools/as/as.cpp:1.19
--- llvm/tools/as/as.cpp:1.18	Thu May 22 15:13:13 2003
+++ llvm/tools/as/as.cpp	Sat May 31 16:47:14 2003
@@ -53,14 +53,18 @@
     if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
 
     if (OutputFilename != "") {   // Specified an output filename?
-      if (!Force && std::ifstream(OutputFilename.c_str())) {
-        // If force is not specified, make sure not to overwrite a file!
-        std::cerr << argv[0] << ": error opening '" << OutputFilename
-                  << "': file exists!\n"
-                  << "Use -f command line argument to force output\n";
-        return 1;
+      if (OutputFilename != "-") {  // Not stdout?
+        if (!Force && std::ifstream(OutputFilename.c_str())) {
+          // If force is not specified, make sure not to overwrite a file!
+          std::cerr << argv[0] << ": error opening '" << OutputFilename
+                    << "': file exists!\n"
+                    << "Use -f command line argument to force output\n";
+          return 1;
+        }
+        Out = new std::ofstream(OutputFilename.c_str());
+      } else {                      // Specified stdout
+	Out = &std::cout;       
       }
-      Out = new std::ofstream(OutputFilename.c_str());
     } else {
       if (InputFilename == "-") {
 	OutputFilename = "-";





More information about the llvm-commits mailing list