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

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


Changes in directory llvm/tools/dis:

dis.cpp updated: 1.30 -> 1.31

---
Log message:

Add support for: -o -



---
Diffs of the changes:

Index: llvm/tools/dis/dis.cpp
diff -u llvm/tools/dis/dis.cpp:1.30 llvm/tools/dis/dis.cpp:1.31
--- llvm/tools/dis/dis.cpp:1.30	Thu May 22 15:13:14 2003
+++ llvm/tools/dis/dis.cpp	Sat May 31 16:47:16 2003
@@ -31,7 +31,7 @@
 InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
 
 static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
+OutputFilename("o", cl::desc("Override output filename"), 
                cl::value_desc("filename"));
 
 static cl::opt<bool>
@@ -60,12 +60,14 @@
   }
   
   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! Sending to standard output.\n";
-    } else {
-      Out = new std::ofstream(OutputFilename.c_str());
+    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! Sending to standard output.\n";
+      } else {
+        Out = new std::ofstream(OutputFilename.c_str());
+      }
     }
   } else {
     if (InputFilename == "-") {





More information about the llvm-commits mailing list