1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

There is no reason to try to materialize the function from bytecode if it

already has been.  This may be a small speedup.

llvm-svn: 17863
This commit is contained in:
Chris Lattner 2004-11-15 23:18:09 +00:00
parent 3ed3e8669f
commit 583ea4764c

View File

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