Add operand info for F3_[12] instructions, getting V8 back to basic functionality.
[oota-llvm.git] / tools / bugpoint / BugDriver.cpp
index ed947c8520e285a3af9bc389cefc6af4184e844c..17e3374117afa9256fae3962391c38944b19a6f3 100644 (file)
@@ -1,10 +1,10 @@
 //===- BugDriver.cpp - Top-Level BugPoint class implementation ------------===//
-// 
+//
 //                     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 class contains all of the shared state and information that is used by
 //===----------------------------------------------------------------------===//
 
 #include "BugDriver.h"
+#include "llvm/Linker.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Assembly/Parser.h"
 #include "llvm/Bytecode/Reader.h"
-#include "llvm/Support/Linker.h"
 #include "llvm/Support/ToolRunner.h"
-#include "Support/CommandLine.h"
-#include "Support/FileUtilities.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileUtilities.h"
+#include <iostream>
 #include <memory>
+
 using namespace llvm;
 
 // Anonymous namespace to define command line options for debugging.
@@ -33,7 +35,7 @@ namespace {
   // otherwise the raw input run through an interpreter is used as the reference
   // source.
   //
-  cl::opt<std::string> 
+  cl::opt<std::string>
   OutputFile("output", cl::desc("Specify a reference program output "
                                 "(for miscompilation detection)"));
 }
@@ -77,7 +79,7 @@ Module *llvm::ParseInputFile(const std::string &InputFilename) {
                 << InputFilename << "'!\n";
     }
   } catch (const ParseException &E) {
-    std::cerr << "bugpoint: " << E.getMessage() << "\n";
+    std::cerr << "bugpoint: " << E.getMessage() << '\n';
     Result = 0;
   }
   return Result;
@@ -103,9 +105,9 @@ bool BugDriver::addSources(const std::vector<std::string> &Filenames) {
 
     std::cout << "Linking in input file: '" << Filenames[i] << "'\n";
     std::string ErrorMessage;
-    if (LinkModules(Program, M.get(), &ErrorMessage)) {
+    if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) {
       std::cerr << ToolName << ": error linking in '" << Filenames[i] << "': "
-                << ErrorMessage << "\n";
+                << ErrorMessage << '\n';
       return true;
     }
   }
@@ -141,7 +143,7 @@ bool BugDriver::run() {
   std::cout << "Running the code generator to test for a crash: ";
   try {
     compileProgram(Program);
-    std::cout << "\n";
+    std::cout << '\n';
   } catch (ToolExecutionError &TEE) {
     std::cout << TEE.what();
     return debugCodeGeneratorCrash();
@@ -154,11 +156,11 @@ bool BugDriver::run() {
   //
   bool CreatedOutput = false;
   if (ReferenceOutputFile.empty()) {
-    std::cout << "Generating reference output from raw program...";
+    std::cout << "Generating reference output from raw program";
     try {
       ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out");
       CreatedOutput = true;
-      std::cout << "Reference output is: " << ReferenceOutputFile << "\n";
+      std::cout << "Reference output is: " << ReferenceOutputFile << '\n';
     } catch (ToolExecutionError &TEE) {
       std::cerr << TEE.what();
       if (Interpreter != cbe) {
@@ -173,7 +175,8 @@ bool BugDriver::run() {
 
   // Make sure the reference output file gets deleted on exit from this
   // function, if appropriate.
-  FileRemover RemoverInstance(ReferenceOutputFile, CreatedOutput);
+  sys::Path ROF(ReferenceOutputFile);
+  FileRemover RemoverInstance(ROF, CreatedOutput);
 
   // Diff the output of the raw program against the reference output.  If it
   // matches, then we have a miscompilation bug.