Adapt to new interface function materialization interface

llvm-svn: 29051
This commit is contained in:
Chris Lattner 2006-07-07 17:18:09 +00:00
parent a41def5801
commit b30f735cf3
1 changed files with 5 additions and 9 deletions

View File

@ -256,18 +256,14 @@ void *JIT::getPointerToFunction(Function *F) {
return Addr; // Check if function already code gen'd return Addr; // Check if function already code gen'd
// Make sure we read in the function if it exists in this Module // Make sure we read in the function if it exists in this Module
if (F->hasNotBeenReadFromBytecode()) if (F->hasNotBeenReadFromBytecode()) {
try { std::string ErrorMsg;
MP->materializeFunction(F); if (MP->materializeFunction(F, &ErrorMsg)) {
} catch ( std::string& errmsg ) {
std::cerr << "Error reading function '" << F->getName() std::cerr << "Error reading function '" << F->getName()
<< "' from bytecode file: " << errmsg << "\n"; << "' from bytecode file: " << ErrorMsg << "\n";
abort();
} catch (...) {
std::cerr << "Error reading function '" << F->getName()
<< "from bytecode file!\n";
abort(); abort();
} }
}
if (F->isExternal()) { if (F->isExternal()) {
void *Addr = getPointerToNamedFunction(F->getName()); void *Addr = getPointerToNamedFunction(F->getName());