summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ModuleProvider.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-09-18 16:17:06 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-09-18 16:17:06 +0000
commit3d72faddeb0fc984f168a503e6cf83ad0a65b795 (patch)
tree534e1444f333a51970c096b94b586fcf9641b45c /llvm/lib/VMCore/ModuleProvider.cpp
parent1d33258b99f37203f9bff8049a2e094ec885bcb1 (diff)
downloadbcm5719-llvm-3d72faddeb0fc984f168a503e6cf83ad0a65b795.tar.gz
bcm5719-llvm-3d72faddeb0fc984f168a503e6cf83ad0a65b795.zip
Minimal implementation of the abstract ModuleProvider interface.
llvm-svn: 8594
Diffstat (limited to 'llvm/lib/VMCore/ModuleProvider.cpp')
-rw-r--r--llvm/lib/VMCore/ModuleProvider.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/ModuleProvider.cpp b/llvm/lib/VMCore/ModuleProvider.cpp
new file mode 100644
index 00000000000..52c30cd1311
--- /dev/null
+++ b/llvm/lib/VMCore/ModuleProvider.cpp
@@ -0,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);
+ }
+}
OpenPOWER on IntegriCloud