The return value of compileSharedObject was never used. Return the shared

object's name instead

llvm-svn: 9120
This commit is contained in:
Chris Lattner 2003-10-14 21:09:11 +00:00
parent 74d64c7d02
commit f8a84dbff3
3 changed files with 10 additions and 9 deletions

View File

@ -85,8 +85,8 @@ public:
/// compileSharedObject - This method creates a SharedObject from a given /// compileSharedObject - This method creates a SharedObject from a given
/// BytecodeFile for debugging a code generator. /// BytecodeFile for debugging a code generator.
int compileSharedObject(const std::string &BytecodeFile, ///
std::string &SharedObject); std::string compileSharedObject(const std::string &BytecodeFile);
/// debugCodeGenerator - This method narrows down a module to a function or /// debugCodeGenerator - This method narrows down a module to a function or
/// set of functions, using the CBE as a ``safe'' code generator for other /// set of functions, using the CBE as a ``safe'' code generator for other

View File

@ -225,8 +225,7 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
} }
// Make a shared library // Make a shared library
std::string SharedObject; std::string SharedObject = compileSharedObject(SafeModuleBC);
BD.compileSharedObject(SafeModuleBC, SharedObject);
delete SafeModule; delete SafeModule;
delete TestModule; delete TestModule;

View File

@ -135,16 +135,16 @@ std::string BugDriver::executeProgramWithCBE(std::string OutputFile,
return executeProgram(OutputFile, BytecodeFile, SharedObject, cbe); return executeProgram(OutputFile, BytecodeFile, SharedObject, cbe);
} }
int BugDriver::compileSharedObject(const std::string &BytecodeFile, std::string BugDriver::compileSharedObject(const std::string &BytecodeFile) {
std::string &SharedObject) {
assert(Interpreter && "Interpreter should have been created already!"); assert(Interpreter && "Interpreter should have been created already!");
std::string Message, OutputCFile; std::string OutputCFile;
// Using CBE // Using CBE
cbe->OutputC(BytecodeFile, OutputCFile); cbe->OutputC(BytecodeFile, OutputCFile);
#if 0 /* This is an alternative, as yet unimplemented */ #if 0 /* This is an alternative, as yet unimplemented */
// Using LLC // Using LLC
std::string Message;
LLC *llc = createLLCtool(Message); LLC *llc = createLLCtool(Message);
if (llc->OutputAsm(BytecodeFile, OutputFile)) { if (llc->OutputAsm(BytecodeFile, OutputFile)) {
std::cerr << "Could not generate asm code with `llc', exiting.\n"; std::cerr << "Could not generate asm code with `llc', exiting.\n";
@ -152,12 +152,14 @@ int BugDriver::compileSharedObject(const std::string &BytecodeFile,
} }
#endif #endif
gcc->MakeSharedObject(OutputCFile, CFile, SharedObject); std::string SharedObjectFile;
if (gcc->MakeSharedObject(OutputCFile, CFile, SharedObject))
exit(1);
// Remove the intermediate C file // Remove the intermediate C file
removeFile(OutputCFile); removeFile(OutputCFile);
return 0; return SharedObjectFile;
} }