summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Module.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-10 07:58:01 +0000
committerChris Lattner <sabre@nondot.org>2001-09-10 07:58:01 +0000
commitda9755002f3ab593b745dd055f4c3ff1ad66aac7 (patch)
treea778381d84adcc740d5211ce9894bdce55d40532 /llvm/lib/VMCore/Module.cpp
parentbaf08eb2a7845d48a0945f26a3bd80098f63a116 (diff)
downloadbcm5719-llvm-da9755002f3ab593b745dd055f4c3ff1ad66aac7.tar.gz
bcm5719-llvm-da9755002f3ab593b745dd055f4c3ff1ad66aac7.zip
Implement global variable support
llvm-svn: 530
Diffstat (limited to 'llvm/lib/VMCore/Module.cpp')
-rw-r--r--llvm/lib/VMCore/Module.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Module.cpp b/llvm/lib/VMCore/Module.cpp
index 4ab8bb06fc6..5fc11d1b10f 100644
--- a/llvm/lib/VMCore/Module.cpp
+++ b/llvm/lib/VMCore/Module.cpp
@@ -6,6 +6,7 @@
#include "llvm/Module.h"
#include "llvm/Method.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/BasicBlock.h"
#include "llvm/InstrTypes.h"
#include "llvm/ValueHolderImpl.h"
@@ -15,15 +16,18 @@
// Instantiate Templates - This ugliness is the price we have to pay
// for having a DefHolderImpl.h file seperate from DefHolder.h! :(
//
+template class ValueHolder<GlobalVariable, Module, Module>;
template class ValueHolder<Method, Module, Module>;
Module::Module()
: Value(Type::VoidTy, Value::ModuleVal, ""), SymTabValue(this),
- MethodList(this, this) {
+ GlobalList(this, this), MethodList(this, this) {
}
Module::~Module() {
dropAllReferences();
+ GlobalList.delete_all();
+ GlobalList.setParent(0);
MethodList.delete_all();
MethodList.setParent(0);
}
@@ -46,6 +50,12 @@ void Module::dropAllReferences() {
// reduceApply - Apply the specified function to all of the methods in this
// module. The result values are or'd together and the result is returned.
//
+bool Module::reduceApply(bool (*Func)(GlobalVariable*)) {
+ return reduce_apply_bool(gbegin(), gend(), Func);
+}
+bool Module::reduceApply(bool (*Func)(const GlobalVariable*)) const {
+ return reduce_apply_bool(gbegin(), gend(), Func);
+}
bool Module::reduceApply(bool (*Func)(Method*)) {
return reduce_apply_bool(begin(), end(), Func);
}
OpenPOWER on IntegriCloud