summaryrefslogtreecommitdiff
path: root/lib/VMCore/Globals.cpp
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 /lib/VMCore/Globals.cpp
parentb12261ac698bf9c8dd118bb94d87aae266dac98a (diff)
downloadllvm-96d83f63cdbb33c075901b1b84eb07622d86386f.tar.gz
llvm-96d83f63cdbb33c075901b1b84eb07622d86386f.tar.bz2
llvm-96d83f63cdbb33c075901b1b84eb07622d86386f.tar.xz
Adjust to changes in User class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Globals.cpp')
-rw-r--r--lib/VMCore/Globals.cpp13
1 files changed, 8 insertions, 5 deletions
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);