Add support for: -o -


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6485 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp
index b52354e..bf46fe6 100644
--- a/tools/llvm-dis/llvm-dis.cpp
+++ b/tools/llvm-dis/llvm-dis.cpp
@@ -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 == "-") {