diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-09-22 23:35:23 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-09-22 23:35:23 +0000 |
commit | fdf148ea71e7ff836f67497a0e18885434abdef6 (patch) | |
tree | 3d56d721053cf53b28fda682d3e4a1154a332173 /include | |
parent | dd7036d19a3bfd3dff2531c7fdcd7901b2442de9 (diff) | |
download | external_llvm-fdf148ea71e7ff836f67497a0e18885434abdef6.zip external_llvm-fdf148ea71e7ff836f67497a0e18885434abdef6.tar.gz external_llvm-fdf148ea71e7ff836f67497a0e18885434abdef6.tar.bz2 |
Materialize the module before releasing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ModuleProvider.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/llvm/ModuleProvider.h b/include/llvm/ModuleProvider.h index 19b0005..8ef7427 100644 --- a/include/llvm/ModuleProvider.h +++ b/include/llvm/ModuleProvider.h @@ -11,17 +11,16 @@ class Function; class Module; class AbstractModuleProvider { - Module *M; - protected: + Module *TheModule; AbstractModuleProvider(); public: virtual ~AbstractModuleProvider(); - /// getModule - returns the module this provider is encapsulating + /// getModule - returns the module this provider is encapsulating. /// - Module* getModule() { return M; } + Module* getModule() { return TheModule; } /// materializeFunction - make sure the given function is fully read. /// @@ -33,7 +32,13 @@ public: /// releaseModule - no longer delete the Module* when provider is destroyed. /// - Module* releaseModule() { Module *tempM = M; M = 0; return tempM; } + virtual Module* releaseModule() { + // Since we're losing control of this Module, we must hand it back complete + materializeModule(); + Module *tempM = TheModule; + TheModule = 0; + return tempM; + } }; |