mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Materialize the module before releasing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8668 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -11,17 +11,16 @@ class Function;
|
|||||||
class Module;
|
class Module;
|
||||||
|
|
||||||
class AbstractModuleProvider {
|
class AbstractModuleProvider {
|
||||||
Module *M;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Module *TheModule;
|
||||||
AbstractModuleProvider();
|
AbstractModuleProvider();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~AbstractModuleProvider();
|
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.
|
/// materializeFunction - make sure the given function is fully read.
|
||||||
///
|
///
|
||||||
@ -33,7 +32,13 @@ public:
|
|||||||
|
|
||||||
/// releaseModule - no longer delete the Module* when provider is destroyed.
|
/// 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;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user