1 //===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===//
3 // Abstract interface for providing a module.
5 //===----------------------------------------------------------------------===//
7 #ifndef MODULEPROVIDER_H
8 #define MODULEPROVIDER_H
13 class AbstractModuleProvider {
16 AbstractModuleProvider();
19 virtual ~AbstractModuleProvider();
21 /// getModule - returns the module this provider is encapsulating.
23 Module* getModule() { return TheModule; }
25 /// materializeFunction - make sure the given function is fully read.
27 virtual void materializeFunction(Function *F) = 0;
29 /// materializeModule - make sure the entire Module has been completely read.
31 void materializeModule();
33 /// releaseModule - no longer delete the Module* when provider is destroyed.
35 virtual Module* releaseModule() {
36 // Since we're losing control of this Module, we must hand it back complete
38 Module *tempM = TheModule;