Remove the C backend.
[oota-llvm.git] / tools / bugpoint / ToolRunner.cpp
index b80a5b437328b28dd6f5805555d280a27bcae554..25a2baef7dc84e21940095c4b6dc7a0c0a60f27c 100644 (file)
@@ -623,94 +623,6 @@ AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0,
   return 0;
 }
 
-GCC::FileType CBE::OutputCode(const std::string &Bitcode,
-                              sys::Path &OutputCFile, std::string &Error,
-                              unsigned Timeout, unsigned MemoryLimit) {
-  sys::Path uniqueFile(Bitcode+".cbe.c");
-  std::string ErrMsg;
-  if (uniqueFile.makeUnique(true, &ErrMsg)) {
-    errs() << "Error making unique filename: " << ErrMsg << "\n";
-    exit(1);
-  }
-  OutputCFile = uniqueFile;
-  std::vector<const char *> LLCArgs;
-  LLCArgs.push_back(LLCPath.c_str());
-
-  // Add any extra LLC args.
-  for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
-    LLCArgs.push_back(ToolArgs[i].c_str());
-
-  LLCArgs.push_back("-o");
-  LLCArgs.push_back(OutputCFile.c_str());   // Output to the C file
-  LLCArgs.push_back("-march=c");            // Output C language
-  LLCArgs.push_back(Bitcode.c_str());      // This is the input bitcode
-  LLCArgs.push_back(0);
-
-  outs() << "<cbe>"; outs().flush();
-  DEBUG(errs() << "\nAbout to run:\t";
-        for (unsigned i = 0, e = LLCArgs.size()-1; i != e; ++i)
-          errs() << " " << LLCArgs[i];
-        errs() << "\n";
-        );
-  if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], sys::Path(), sys::Path(),
-                            sys::Path(), Timeout, MemoryLimit))
-    Error = ProcessFailure(LLCPath, &LLCArgs[0], Timeout, MemoryLimit);
-  return GCC::CFile;
-}
-
-void CBE::compileProgram(const std::string &Bitcode, std::string *Error,
-                         unsigned Timeout, unsigned MemoryLimit) {
-  sys::Path OutputCFile;
-  OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
-  OutputCFile.eraseFromDisk();
-}
-
-int CBE::ExecuteProgram(const std::string &Bitcode,
-                        const std::vector<std::string> &Args,
-                        const std::string &InputFile,
-                        const std::string &OutputFile,
-                        std::string *Error,
-                        const std::vector<std::string> &ArgsForGCC,
-                        const std::vector<std::string> &SharedLibs,
-                        unsigned Timeout,
-                        unsigned MemoryLimit) {
-  sys::Path OutputCFile;
-  OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
-
-  FileRemover CFileRemove(OutputCFile.str(), !SaveTemps);
-
-  std::vector<std::string> GCCArgs(ArgsForGCC);
-  GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
-
-  return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile,
-                             InputFile, OutputFile, Error, GCCArgs,
-                             Timeout, MemoryLimit);
-}
-
-/// createCBE - Try to find the 'llc' executable
-///
-CBE *AbstractInterpreter::createCBE(const char *Argv0,
-                                    std::string &Message,
-                                    const std::string &GCCBinary,
-                                    const std::vector<std::string> *Args,
-                                    const std::vector<std::string> *GCCArgs) {
-  sys::Path LLCPath =
-    PrependMainExecutablePath("llc", Argv0, (void *)(intptr_t)&createCBE);
-  if (LLCPath.isEmpty()) {
-    Message =
-      "Cannot find `llc' in executable directory!\n";
-    return 0;
-  }
-
-  Message = "Found llc: " + LLCPath.str() + "\n";
-  GCC *gcc = GCC::create(Message, GCCBinary, GCCArgs);
-  if (!gcc) {
-    errs() << Message << "\n";
-    exit(1);
-  }
-  return new CBE(LLCPath, gcc, Args);
-}
-
 //===---------------------------------------------------------------------===//
 // GCC abstraction
 //