Don't translate "-" to outs() manually; raw_ostream does that
authorDan Gohman <gohman@apple.com>
Wed, 18 Aug 2010 17:26:50 +0000 (17:26 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 18 Aug 2010 17:26:50 +0000 (17:26 +0000)
automatically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111370 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index 5e36351b08f188758b584c2132d51e22cfa69484..5a23b2771048c1aee64650155708e0ed8c90cb4c 100644 (file)
@@ -127,14 +127,11 @@ GetFileNameRoot(const std::string &InputFilename) {
 static formatted_raw_ostream *GetOutputStream(const char *TargetName,
                                               Triple::OSType OS,
                                               const char *ProgName) {
-  if (OutputFilename != "") {
-    if (OutputFilename == "-")
-      return new formatted_raw_ostream(outs(),
-                                       formatted_raw_ostream::PRESERVE_STREAM);
-
+  if (!OutputFilename.empty()) {
     // Make sure that the Out file gets unlinked from the disk if we get a
     // SIGINT
-    sys::RemoveFileOnSignal(sys::Path(OutputFilename));
+    if (OutputFilename != "-")
+      sys::RemoveFileOnSignal(sys::Path(OutputFilename));
 
     std::string error;
     raw_fd_ostream *FDOut =