summaryrefslogtreecommitdiff
path: root/lib/Transforms/ExprTypeConvert.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-29 00:37:36 +0000
committerChris Lattner <sabre@nondot.org>2005-01-29 00:37:36 +0000
commit5598aa0328fd3a1cc0b93c461f0474e09c10662c (patch)
tree362bcbef99c12d3bfc6c69e10df6d66f3aff63bf /lib/Transforms/ExprTypeConvert.cpp
parent23ba420550499a071f70af7022847479d1165c68 (diff)
downloadllvm-5598aa0328fd3a1cc0b93c461f0474e09c10662c.tar.gz
llvm-5598aa0328fd3a1cc0b93c461f0474e09c10662c.tar.bz2
llvm-5598aa0328fd3a1cc0b93c461f0474e09c10662c.tar.xz
Adjust Valuehandle to hold its operand directly in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/ExprTypeConvert.cpp')
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index c95efacbbd..5822124231 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -1258,15 +1258,14 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
ValueHandle::ValueHandle(ValueMapCache &VMC, Value *V)
- : Instruction(Type::VoidTy, UserOp1, ""), Cache(VMC) {
+ : Instruction(Type::VoidTy, UserOp1, &Op, 1, ""), Op(V, this), Cache(VMC) {
//DEBUG(std::cerr << "VH AQUIRING: " << (void*)V << " " << V);
- Operands.push_back(Use(V, this));
}
ValueHandle::ValueHandle(const ValueHandle &VH)
- : Instruction(Type::VoidTy, UserOp1, ""), Cache(VH.Cache) {
+ : Instruction(Type::VoidTy, UserOp1, &Op, 1, ""),
+ Op(VH.Op, this), Cache(VH.Cache) {
//DEBUG(std::cerr << "VH AQUIRING: " << (void*)V << " " << V);
- Operands.push_back(Use((Value*)VH.getOperand(0), this));
}
static void RecursiveDelete(ValueMapCache &Cache, Instruction *I) {
@@ -1291,9 +1290,9 @@ static void RecursiveDelete(ValueMapCache &Cache, Instruction *I) {
}
ValueHandle::~ValueHandle() {
- if (Operands[0]->hasOneUse()) {
- Value *V = Operands[0];
- Operands[0] = 0; // Drop use!
+ if (Op->hasOneUse()) {
+ Value *V = Op;
+ Op.set(0); // Drop use!
// Now we just need to remove the old instruction so we don't get infinite
// loops. Note that we cannot use DCE because DCE won't remove a store