The C backend is no longer in llvm-dis, it's in llc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-02-17 06:40:06 +00:00
parent df2cf418a8
commit 9915cd9e9f
2 changed files with 22 additions and 22 deletions

View File

@ -215,19 +215,19 @@ int CBE::OutputC(const std::string &Bytecode,
std::string &OutputCFile) { std::string &OutputCFile) {
OutputCFile = getUniqueFilename(Bytecode+".cbe.c"); OutputCFile = getUniqueFilename(Bytecode+".cbe.c");
const char *DisArgs[] = { const char *DisArgs[] = {
DISPath.c_str(), LLCPath.c_str(),
"-o", OutputCFile.c_str(), // Output to the C file "-o", OutputCFile.c_str(), // Output to the C file
"-c", // Output to C "-march=c", // Output to C
"-f", // Overwrite as necessary... "-f", // Overwrite as necessary...
Bytecode.c_str(), // This is the input bytecode Bytecode.c_str(), // This is the input bytecode
0 0
}; };
std::cout << "<cbe>" << std::flush; std::cout << "<cbe>" << std::flush;
if (RunProgramWithTimeout(DISPath, DisArgs, "/dev/null", "/dev/null", if (RunProgramWithTimeout(LLCPath, DisArgs, "/dev/null", "/dev/null",
"/dev/null")) { "/dev/null")) {
// If dis failed on the bytecode, print error... // If dis failed on the bytecode, print error...
std::cerr << "Error: `llvm-dis -c' failed!\n"; std::cerr << "Error: `llc -march=c' failed!\n";
return 1; return 1;
} }
@ -241,7 +241,7 @@ int CBE::ExecuteProgram(const std::string &Bytecode,
const std::vector<std::string> &SharedLibs) { const std::vector<std::string> &SharedLibs) {
std::string OutputCFile; std::string OutputCFile;
if (OutputC(Bytecode, OutputCFile)) { if (OutputC(Bytecode, OutputCFile)) {
std::cerr << "Could not generate C code with `llvm-dis', exiting.\n"; std::cerr << "Could not generate C code with `llc', exiting.\n";
exit(1); exit(1);
} }
@ -252,24 +252,24 @@ int CBE::ExecuteProgram(const std::string &Bytecode,
return Result; return Result;
} }
/// createCBE - Try to find the 'llvm-dis' executable /// createCBE - Try to find the 'llc' executable
/// ///
CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath, CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath,
std::string &Message) { std::string &Message) {
std::string DISPath = FindExecutable("llvm-dis", ProgramPath); std::string LLCPath = FindExecutable("llc", ProgramPath);
if (DISPath.empty()) { if (LLCPath.empty()) {
Message = Message =
"Cannot find `llvm-dis' in executable directory or PATH!\n"; "Cannot find `llc' in executable directory or PATH!\n";
return 0; return 0;
} }
Message = "Found llvm-dis: " + DISPath + "\n"; Message = "Found llc: " + LLCPath + "\n";
GCC *gcc = GCC::create(ProgramPath, Message); GCC *gcc = GCC::create(ProgramPath, Message);
if (!gcc) { if (!gcc) {
std::cerr << Message << "\n"; std::cerr << Message << "\n";
exit(1); exit(1);
} }
return new CBE(DISPath, gcc); return new CBE(LLCPath, gcc);
} }
//===---------------------------------------------------------------------===// //===---------------------------------------------------------------------===//

View File

@ -215,19 +215,19 @@ int CBE::OutputC(const std::string &Bytecode,
std::string &OutputCFile) { std::string &OutputCFile) {
OutputCFile = getUniqueFilename(Bytecode+".cbe.c"); OutputCFile = getUniqueFilename(Bytecode+".cbe.c");
const char *DisArgs[] = { const char *DisArgs[] = {
DISPath.c_str(), LLCPath.c_str(),
"-o", OutputCFile.c_str(), // Output to the C file "-o", OutputCFile.c_str(), // Output to the C file
"-c", // Output to C "-march=c", // Output to C
"-f", // Overwrite as necessary... "-f", // Overwrite as necessary...
Bytecode.c_str(), // This is the input bytecode Bytecode.c_str(), // This is the input bytecode
0 0
}; };
std::cout << "<cbe>" << std::flush; std::cout << "<cbe>" << std::flush;
if (RunProgramWithTimeout(DISPath, DisArgs, "/dev/null", "/dev/null", if (RunProgramWithTimeout(LLCPath, DisArgs, "/dev/null", "/dev/null",
"/dev/null")) { "/dev/null")) {
// If dis failed on the bytecode, print error... // If dis failed on the bytecode, print error...
std::cerr << "Error: `llvm-dis -c' failed!\n"; std::cerr << "Error: `llc -march=c' failed!\n";
return 1; return 1;
} }
@ -241,7 +241,7 @@ int CBE::ExecuteProgram(const std::string &Bytecode,
const std::vector<std::string> &SharedLibs) { const std::vector<std::string> &SharedLibs) {
std::string OutputCFile; std::string OutputCFile;
if (OutputC(Bytecode, OutputCFile)) { if (OutputC(Bytecode, OutputCFile)) {
std::cerr << "Could not generate C code with `llvm-dis', exiting.\n"; std::cerr << "Could not generate C code with `llc', exiting.\n";
exit(1); exit(1);
} }
@ -252,24 +252,24 @@ int CBE::ExecuteProgram(const std::string &Bytecode,
return Result; return Result;
} }
/// createCBE - Try to find the 'llvm-dis' executable /// createCBE - Try to find the 'llc' executable
/// ///
CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath, CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath,
std::string &Message) { std::string &Message) {
std::string DISPath = FindExecutable("llvm-dis", ProgramPath); std::string LLCPath = FindExecutable("llc", ProgramPath);
if (DISPath.empty()) { if (LLCPath.empty()) {
Message = Message =
"Cannot find `llvm-dis' in executable directory or PATH!\n"; "Cannot find `llc' in executable directory or PATH!\n";
return 0; return 0;
} }
Message = "Found llvm-dis: " + DISPath + "\n"; Message = "Found llc: " + LLCPath + "\n";
GCC *gcc = GCC::create(ProgramPath, Message); GCC *gcc = GCC::create(ProgramPath, Message);
if (!gcc) { if (!gcc) {
std::cerr << Message << "\n"; std::cerr << Message << "\n";
exit(1); exit(1);
} }
return new CBE(DISPath, gcc); return new CBE(LLCPath, gcc);
} }
//===---------------------------------------------------------------------===// //===---------------------------------------------------------------------===//