diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-15 23:18:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-15 23:18:09 +0000 |
commit | 0050ef831912eea2377c815bc59c09ed828f2684 (patch) | |
tree | 42f3ec83c3748a3b71624ea1223eaa090334eb10 /lib/ExecutionEngine/JIT/JIT.cpp | |
parent | 5aa3ed92de45f7fa72135cb04816ffa264e5284c (diff) |
There is no reason to try to materialize the function from bytecode if it
already has been. This may be a small speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index d9866c87ee..71f1dd0d6b 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -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()); |