Fix an iterator invalidation problem in a "buggy" pass
[oota-llvm.git] / tools / bugpoint / ToolRunner.cpp
index a15de5e4e6b819369f4c713ee9dd87dc15f01387..4a7be56461a5cb19053460bf9da34d2bc5bee9b7 100644 (file)
@@ -21,6 +21,8 @@
 #include <sstream>
 using namespace llvm;
 
+ToolExecutionError::~ToolExecutionError() throw() { }
+
 static void ProcessFailure(std::string ProgPath, const char** Args) {
   std::ostringstream OS;
   OS << "\nError running tool:\n ";
@@ -126,6 +128,12 @@ void LLC::OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile) {
     ProcessFailure(LLCPath, LLCArgs);
 }
 
+void LLC::compileProgram(const std::string &Bytecode) {
+  std::string OutputAsmFile;
+  OutputAsm(Bytecode, OutputAsmFile);
+  removeFile(OutputAsmFile);
+}
+
 int LLC::ExecuteProgram(const std::string &Bytecode,
                         const std::vector<std::string> &Args,
                         const std::string &InputFile,
@@ -243,6 +251,12 @@ void CBE::OutputC(const std::string &Bytecode,
     ProcessFailure(LLCPath, LLCArgs);
 }
 
+void CBE::compileProgram(const std::string &Bytecode) {
+  std::string OutputCFile;
+  OutputC(Bytecode, OutputCFile);
+  removeFile(OutputCFile);
+}
+
 int CBE::ExecuteProgram(const std::string &Bytecode,
                         const std::vector<std::string> &Args,
                         const std::string &InputFile,