#include "llvm/Module.h"
#include "llvm/Method.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/BasicBlock.h"
#include "llvm/InstrTypes.h"
#include "llvm/ValueHolderImpl.h"
// 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);
}
// 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);
}