object's name instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9120
91177308-0d34-0410-b5e6-
96231b3b80d8
/// compileSharedObject - This method creates a SharedObject from a given
/// BytecodeFile for debugging a code generator.
/// compileSharedObject - This method creates a SharedObject from a given
/// 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
/// set of functions, using the CBE as a ``safe'' code generator for other
/// debugCodeGenerator - This method narrows down a module to a function or
/// set of functions, using the CBE as a ``safe'' code generator for other
}
// Make a shared library
}
// Make a shared library
- std::string SharedObject;
- BD.compileSharedObject(SafeModuleBC, SharedObject);
+ std::string SharedObject = compileSharedObject(SafeModuleBC);
delete SafeModule;
delete TestModule;
delete SafeModule;
delete TestModule;
return executeProgram(OutputFile, BytecodeFile, SharedObject, cbe);
}
return executeProgram(OutputFile, BytecodeFile, SharedObject, cbe);
}
-int BugDriver::compileSharedObject(const std::string &BytecodeFile,
- std::string &SharedObject) {
+std::string BugDriver::compileSharedObject(const std::string &BytecodeFile) {
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
cbe->OutputC(BytecodeFile, OutputCFile);
#if 0 /* This is an alternative, as yet unimplemented */
// Using LLC
// Using CBE
cbe->OutputC(BytecodeFile, OutputCFile);
#if 0 /* This is an alternative, as yet unimplemented */
// Using LLC
LLC *llc = createLLCtool(Message);
if (llc->OutputAsm(BytecodeFile, OutputFile)) {
std::cerr << "Could not generate asm code with `llc', exiting.\n";
LLC *llc = createLLCtool(Message);
if (llc->OutputAsm(BytecodeFile, OutputFile)) {
std::cerr << "Could not generate asm code with `llc', exiting.\n";
- gcc->MakeSharedObject(OutputCFile, CFile, SharedObject);
+ std::string SharedObjectFile;
+ if (gcc->MakeSharedObject(OutputCFile, CFile, SharedObject))
+ exit(1);
// Remove the intermediate C file
removeFile(OutputCFile);
// Remove the intermediate C file
removeFile(OutputCFile);
+ return SharedObjectFile;