Fix http://llvm.org/PR4822: allow module deletion after a function has been
authorJeffrey Yasskin <jyasskin@google.com>
Fri, 23 Oct 2009 22:37:43 +0000 (22:37 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Fri, 23 Oct 2009 22:37:43 +0000 (22:37 +0000)
commit23e5fcfec4640955fec41dc8348f467adf1a3e56
treeff1de1e3e7b059ed882c0e5c6a3e1c7a8632ddde
parent7b929dad59785f62a66f7c58615082f98441e95e
Fix llvm.org/PR4822: allow module deletion after a function has been
compiled.

When functions are compiled, they accumulate references in the JITResolver's
stub maps. This patch removes those references when the functions are
destroyed.  It's illegal to destroy a Function when any thread may still try to
call its machine code.

This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs
and fixes a couple "do stuff inside assert()" bugs from r84522.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84975 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ExecutionEngine/ExecutionEngine.h
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/JIT/JITEmitter.cpp
unittests/ExecutionEngine/JIT/JITTest.cpp
unittests/ExecutionEngine/JIT/Makefile