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 {
17 AbstractModuleProvider();
20 virtual ~AbstractModuleProvider();
22 /// getModule - returns the module this provider is encapsulating
24 Module* getModule() { return M; }
26 /// materializeFunction - make sure the given function is fully read.
28 virtual void materializeFunction(Function *F) = 0;
30 /// materializeModule - make sure the entire Module has been completely read.
32 void materializeModule();
34 /// releaseModule - no longer delete the Module* when provider is destroyed.
36 Module* releaseModule() { Module *tempM = M; M = 0; return tempM; }