[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.
authorLang Hames <lhames@gmail.com>
Wed, 22 Oct 2014 23:18:42 +0000 (23:18 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 22 Oct 2014 23:18:42 +0000 (23:18 +0000)
commit950c6482c6a4904fd8ae26610af5cec4fd8abd17
treec3c60af2845403bd5c6922d6760b58c455656628
parentae3811c355bfcf37d2c3573038b3ac216fee89f0
[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.

MCJIT::getPointerForFunction adds the resulting address to the global mapping.
This should be done via updateGlobalMapping rather than addGlobalMapping, since
the latter asserts if a mapping already exists.

MCJIT::getPointerToFunction is actually deprecated - hopefully we can remove it
(or more likely re-task it) entirely soon. In the mean time it should at least
work as advertised.

<rdar://problem/18727946>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220444 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ExecutionEngine/MCJIT/MCJIT.cpp
unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
unittests/ExecutionEngine/MCJIT/MCJITTestBase.h