Fix PR6360. It's easy for a stub's address to escape to user code, so we can't
authorJeffrey Yasskin <jyasskin@google.com>
Thu, 4 Mar 2010 19:45:09 +0000 (19:45 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Thu, 4 Mar 2010 19:45:09 +0000 (19:45 +0000)
commit39c75f2e907c577a4f922daccf1f7d04acc9438e
tree13876af53a9b6ff33b6351b6935804d847c98c53
parentba72b0c4e17795fd61e18d022a6d86a680be00c5
Fix PR6360.  It's easy for a stub's address to escape to user code, so we can't
just count references to it from JIT output to decide when to destroy it.  This
patch waits to destroy the JIT's memory of a stub until the Function it refers
to is destroyed.  External function stubs and GVIndirectSyms aren't destroyed
until the JIT itself is.

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