aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-29 00:35:33 +0000
committerChris Lattner <sabre@nondot.org>2005-01-29 00:35:33 +0000
commit96d83f63cdbb33c075901b1b84eb07622d86386f (patch)
treea48967c081ec5daee63f504957ec8225d3856601
parentb12261ac698bf9c8dd118bb94d87aae266dac98a (diff)
Adjust to changes in User class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19892 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/BasicBlock.cpp2
-rw-r--r--lib/VMCore/Function.cpp2
-rw-r--r--lib/VMCore/Globals.cpp13
-rw-r--r--lib/VMCore/Instruction.cpp19
4 files changed, 18 insertions, 18 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index b399c55221..25507ce954 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -26,7 +26,7 @@ namespace {
/// DummyInst - An instance of this class is used to mark the end of the
/// instruction list. This is not a real instruction.
struct DummyInst : public Instruction {
- DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd) {
+ DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd, 0, 0) {
// This should not be garbage monitored.
LeakDetector::removeGarbageObject(this);
}
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 340bb1b4d1..c63b1acdc4 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -87,7 +87,7 @@ void Argument::setParent(Function *parent) {
Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
const std::string &name, Module *ParentModule)
- : GlobalValue(PointerType::get(Ty), Value::FunctionVal, Linkage, name) {
+ : GlobalValue(PointerType::get(Ty), Value::FunctionVal, 0, 0, Linkage, name) {
BasicBlocks.setItemParent(this);
BasicBlocks.setParent(this);
ArgumentList.setItemParent(this);
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp
index 731f495c29..8bcb531324 100644
--- a/lib/VMCore/Globals.cpp
+++ b/lib/VMCore/Globals.cpp
@@ -72,14 +72,17 @@ void GlobalValue::destroyConstant() {
//===----------------------------------------------------------------------===//
GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link,
- Constant *Initializer,
+ Constant *InitVal,
const std::string &Name, Module *ParentModule)
- : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, Link, Name),
+ : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal,
+ &Initializer, InitVal != 0, Link, Name),
isConstantGlobal(constant) {
- if (Initializer) {
- assert(Initializer->getType() == Ty &&
+ if (InitVal) {
+ assert(InitVal->getType() == Ty &&
"Initializer should be the same type as the GlobalVariable!");
- Operands.push_back(Use((Value*)Initializer, this));
+ Initializer.init(InitVal, this);
+ } else {
+ Initializer.init(0, this);
}
LeakDetector::addGarbageObject(this);
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index 696b12e27b..b449c9962f 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -18,15 +18,11 @@
#include "llvm/Support/LeakDetector.h"
using namespace llvm;
-void Instruction::init() {
+Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
+ const std::string &Name, Instruction *InsertBefore)
+ : User(ty, Value::InstructionVal + it, Ops, NumOps, Name), Parent(0) {
// Make sure that we get added to a basicblock
LeakDetector::addGarbageObject(this);
-}
-
-Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
- Instruction *InsertBefore)
- : User(ty, Value::InstructionVal + it, Name), Parent(0) {
- init();
// If requested, insert this instruction into a basic block...
if (InsertBefore) {
@@ -36,10 +32,11 @@ Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
}
}
-Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : User(ty, Value::InstructionVal + it, Name), Parent(0) {
- init();
+Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
+ const std::string &Name, BasicBlock *InsertAtEnd)
+ : User(ty, Value::InstructionVal + it, Ops, NumOps, Name), Parent(0) {
+ // Make sure that we get added to a basicblock
+ LeakDetector::addGarbageObject(this);
// append this instruction into the basic block
assert(InsertAtEnd && "Basic block to append to may not be NULL!");