It is pointless to turn a UINT_TO_FP into an
[oota-llvm.git] / tools / llc / llc.cpp
index c976ee261ecd89202d7a9b31f092b454f6010656..d179efc03831c7cf22f4f344f5fb1655d54d223a 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -134,10 +134,15 @@ static std::ostream *GetOutputStream(const char *ProgName) {
     
   switch (FileType) {
   case TargetMachine::AssemblyFile:
-    if (MArch->Name[0] != 'c' || MArch->Name[1] != 0)  // not CBE
+    if (MArch->Name[0] == 'c') {
+      if (MArch->Name[1] == 0)
+        OutputFilename += ".cbe.c";
+      else if (MArch->Name[1] == 'p' && MArch->Name[2] == 'p')
+        OutputFilename += ".cpp";
+      else
+        OutputFilename += ".s";
+    } else
       OutputFilename += ".s";
-    else
-      OutputFilename += ".cbe.c";
     break;
   case TargetMachine::ObjectFile:
     OutputFilename += ".o";
@@ -246,7 +251,8 @@ int main(int argc, char **argv) {
     PM.run(mod);
   } else {
     // Build up all of the passes that we want to do to the module.
-    FunctionPassManager Passes(new ExistingModuleProvider(M.get()));
+    ExistingModuleProvider Provider(M.release());
+    FunctionPassManager Passes(&Provider);
     Passes.add(new TargetData(*Target.getTargetData()));
     
 #ifndef NDEBUG