diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-05-21 16:34:48 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-05-21 16:34:48 +0000 |
commit | f049e07eb8930214941c72f8e4409df394de1567 (patch) | |
tree | 2b341c3d5caa02213a284f8f01296fa2aa115897 /include | |
parent | a3f334362f86a70fd11196dd49358662579c21a3 (diff) | |
download | external_llvm-f049e07eb8930214941c72f8e4409df394de1567.zip external_llvm-f049e07eb8930214941c72f8e4409df394de1567.tar.gz external_llvm-f049e07eb8930214941c72f8e4409df394de1567.tar.bz2 |
Fix a couple issues with the JIT and multiple modules:
1. The "JITState" object creates a PassManager with the ModuleProvider that the
jit is created with. If the ModuleProvider is removed and deleted, the
PassManager is invalid.
2. The Global maps in the JIT were not invalidated with a ModuleProvider was
removed. This could lead to a case where the Module would be freed, and a
new Module with Globals at the same addresses could return invalid results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index ff58473..1159971 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -126,7 +126,7 @@ public: /// addModuleProvider - Add a ModuleProvider to the list of modules that we /// can JIT from. Note that this takes ownership of the ModuleProvider: when /// the ExecutionEngine is destroyed, it destroys the MP as well. - void addModuleProvider(ModuleProvider *P) { + virtual void addModuleProvider(ModuleProvider *P) { Modules.push_back(P); } @@ -137,7 +137,8 @@ public: /// removeModuleProvider - Remove a ModuleProvider from the list of modules. /// Release module from ModuleProvider. - Module* removeModuleProvider(ModuleProvider *P, std::string *ErrInfo = 0); + virtual Module* removeModuleProvider(ModuleProvider *P, + std::string *ErrInfo = 0); /// FindFunctionNamed - Search all of the active modules to find the one that /// defines FnName. This is very slow operation and shouldn't be used for @@ -174,6 +175,10 @@ public: /// use in dynamic compilation scenarios when you want to move globals void clearAllGlobalMappings(); + /// clearGlobalMappingsFromModule - Clear all global mappings that came from a + /// particular module, because it has been removed from the JIT. + void clearGlobalMappingsFromModule(Module *M); + /// updateGlobalMapping - Replace an existing mapping for GV with a new /// address. This updates both maps as required. If "Addr" is null, the /// entry for the global is removed from the mappings. This returns the old |