aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/VM.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-08 21:08:43 +0000
committerChris Lattner <sabre@nondot.org>2003-05-08 21:08:43 +0000
commit66a8494e98a36e2639fa60ab31364290652fe396 (patch)
treee9dce7d8b5795b037bea2db5f18f7e1ec27b210a /lib/ExecutionEngine/JIT/VM.cpp
parentb515f6d2c887173189cf5664de98a6d62a3fd335 (diff)
assert early instead of late for unimplemented feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/VM.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/VM.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/VM.cpp b/lib/ExecutionEngine/JIT/VM.cpp
index c107438f0f..836e00e4fa 100644
--- a/lib/ExecutionEngine/JIT/VM.cpp
+++ b/lib/ExecutionEngine/JIT/VM.cpp
@@ -81,10 +81,17 @@ void *VM::getPointerToFunction(const Function *F) {
if (F->isExternal())
return Addr = getPointerToNamedFunction(F->getName());
- // JIT all of the functions in the module. Eventually this will JIT functions
- // on demand. This has the effect of populating all of the non-external
- // functions into the GlobalAddress table.
+ static bool isAlreadyCodeGenerating = false;
+ if (isAlreadyCodeGenerating) {
+ assert(0 && "Recursive function stubs not handled yet!");
+ }
+
+ // FIXME: JIT all of the functions in the module. Eventually this will JIT
+ // functions on demand. This has the effect of populating all of the
+ // non-external functions into the GlobalAddress table.
+ isAlreadyCodeGenerating = true;
PM.run(getModule());
+ isAlreadyCodeGenerating = false;
assert(Addr && "Code generation didn't add function to GlobalAddress table!");
return Addr;