[llvm-commits] CVS: llvm/lib/VMCore/ModuleProvider.cpp

Misha Brukman brukman at cs.uiuc.edu
Thu Sep 18 11:18:02 PDT 2003


Changes in directory llvm/lib/VMCore:

ModuleProvider.cpp added (r1.1)

---
Log message:

Minimal implementation of the abstract ModuleProvider interface.


---
Diffs of the changes:

Index: llvm/lib/VMCore/ModuleProvider.cpp
diff -c /dev/null llvm/lib/VMCore/ModuleProvider.cpp:1.1
*** /dev/null	Thu Sep 18 11:17:16 2003
--- llvm/lib/VMCore/ModuleProvider.cpp	Thu Sep 18 11:17:06 2003
***************
*** 0 ****
--- 1,28 ----
+ //===-- ModuleProvider.cpp - Base implementation for module providers -----===//
+ //
+ // Minimal implementation of the abstract interface for providing a module.
+ //
+ //===----------------------------------------------------------------------===//
+ 
+ #include "llvm/ModuleProvider.h"
+ #include "llvm/Module.h"
+ 
+ /// ctor - always have a valid Module
+ ///
+ AbstractModuleProvider::AbstractModuleProvider() {
+   M = new Module("");
+ }
+ 
+ /// dtor - when we leave, we take our Module with us
+ ///
+ AbstractModuleProvider::~AbstractModuleProvider() {
+   delete M;
+ }
+ 
+ /// materializeFunction - make sure the given function is fully read.
+ ///
+ void AbstractModuleProvider::materializeModule() {
+   for (Module::iterator i = M->begin(), e = M->end(); i != e; ++i) {
+     materializeFunction(i);
+   }
+ }





More information about the llvm-commits mailing list