1 //===-- ModuleProvider.cpp - Base implementation for module providers -----===//
3 // Minimal implementation of the abstract interface for providing a module.
5 //===----------------------------------------------------------------------===//
7 #include "llvm/ModuleProvider.h"
8 #include "llvm/Module.h"
10 /// ctor - always have a valid Module
12 ModuleProvider::ModuleProvider() : TheModule(0) { }
14 /// dtor - when we leave, we take our Module with us
16 ModuleProvider::~ModuleProvider() {
20 /// materializeFunction - make sure the given function is fully read.
22 Module* ModuleProvider::materializeModule() {
23 // FIXME: throw an exception instead?
24 if (!TheModule) return 0;
26 for (Module::iterator i = TheModule->begin(), e = TheModule->end();
28 materializeFunction(i);