1 //===-- ModuleProvider.cpp - Base implementation for module providers -----===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Minimal implementation of the abstract interface for providing a module.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/ModuleProvider.h"
15 #include "llvm/Module.h"
19 /// ctor - always have a valid Module
21 ModuleProvider::ModuleProvider() : TheModule(0) { }
23 /// dtor - when we leave, we take our Module with us
25 ModuleProvider::~ModuleProvider() {
29 /// materializeFunction - make sure the given function is fully read.
31 Module* ModuleProvider::materializeModule() {
32 assert(TheModule && "Attempting to materialize an invalid module!");
34 for (Module::iterator i = TheModule->begin(), e = TheModule->end();
36 materializeFunction(i);
41 } // End llvm namespace