summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit84d3137da753a5d42f3a7e6b43ba890acc77f68f (patch)
tree871cd9cf7263a6e003cf9116b1dd33568c18003b /llvm/lib/Transforms
parent3479f9cca86f071e6a063b6f8dd07e751f9bd0b9 (diff)
downloadbcm5719-llvm-84d3137da753a5d42f3a7e6b43ba890acc77f68f.tar.gz
bcm5719-llvm-84d3137da753a5d42f3a7e6b43ba890acc77f68f.zip
Adjust Valuehandle to hold its operand directly in it.
llvm-svn: 19897
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/ExprTypeConvert.cpp13
-rw-r--r--llvm/lib/Transforms/TransformInternals.h1
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp
index c95efacbbde..58221242310 100644
--- a/llvm/lib/Transforms/ExprTypeConvert.cpp
+++ b/llvm/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
diff --git a/llvm/lib/Transforms/TransformInternals.h b/llvm/lib/Transforms/TransformInternals.h
index b5747c91303..9b90fcc112d 100644
--- a/llvm/lib/Transforms/TransformInternals.h
+++ b/llvm/lib/Transforms/TransformInternals.h
@@ -59,6 +59,7 @@ const Type *ConvertibleToGEP(const Type *Ty, Value *V,
//
class ValueMapCache;
class ValueHandle : public Instruction {
+ Use Op;
ValueMapCache &Cache;
public:
ValueHandle(ValueMapCache &VMC, Value *V);
OpenPOWER on IntegriCloud