Reindent code to match the rest of the file
authorChris Lattner <sabre@nondot.org>
Wed, 18 Jun 2003 18:46:08 +0000 (18:46 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 18 Jun 2003 18:46:08 +0000 (18:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6772 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index 485b25ef5324ac3bed2cf3567c8b255540667665..3bd35f1f746041ad156344dc694ed25c93ec02ab 100644 (file)
@@ -134,8 +134,28 @@ main(int argc, char **argv)
 
   // Figure out where we are going to send the output...
   std::ostream *Out = 0;
-  if (OutputFilename != "")
-    {   // Specified an output filename?
+  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;
+    }
+    Out = new std::ofstream(OutputFilename.c_str());
+
+    // Make sure that the Out file gets unlink'd from the disk if we get a
+    // SIGINT
+    RemoveFileOnSignal(OutputFilename);
+  } else {
+    if (InputFilename == "-") {
+      OutputFilename = "-";
+      Out = &std::cout;
+    } else {
+      std::string OutputFilename = GetFileNameRoot(InputFilename); 
+      OutputFilename += ".s";
+      
       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
@@ -143,47 +163,19 @@ main(int argc, char **argv)
                   << "Use -f command line argument to force output\n";
         return 1;
       }
+      
       Out = new std::ofstream(OutputFilename.c_str());
-
+      if (!Out->good()) {
+        std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+        delete Out;
+        return 1;
+      }
+      
       // Make sure that the Out file gets unlink'd from the disk if we get a
       // SIGINT
       RemoveFileOnSignal(OutputFilename);
     }
-  else
-    {
-      if (InputFilename == "-")
-        {
-          OutputFilename = "-";
-          Out = &std::cout;
-        }
-      else
-        {
-          std::string OutputFilename = GetFileNameRoot(InputFilename); 
-          OutputFilename += ".s";
-
-          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());
-          if (!Out->good())
-            {
-              std::cerr << argv[0] << ": error opening " << OutputFilename
-                        << "!\n";
-              delete Out;
-              return 1;
-            }
-
-          // Make sure that the Out file gets unlink'd from the disk if we get a
-          // SIGINT
-          RemoveFileOnSignal(OutputFilename);
-        }
-    }
+  }
 
   // Ask the target to add backend passes as neccesary
   if (Target.addPassesToEmitAssembly(Passes, *Out)) {