[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp TransformInternals.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Jan 28 16:37:52 PST 2005
Changes in directory llvm/lib/Transforms:
ExprTypeConvert.cpp updated: 1.100 -> 1.101
TransformInternals.h updated: 1.24 -> 1.25
---
Log message:
Adjust Valuehandle to hold its operand directly in it.
---
Diffs of the changes: (+7 -7)
ExprTypeConvert.cpp | 13 ++++++-------
TransformInternals.h | 1 +
2 files changed, 7 insertions(+), 7 deletions(-)
Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.100 llvm/lib/Transforms/ExprTypeConvert.cpp:1.101
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.100 Sat Jan 8 13:48:40 2005
+++ llvm/lib/Transforms/ExprTypeConvert.cpp Fri Jan 28 18:37:36 2005
@@ -1258,15 +1258,14 @@
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 @@
}
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
Index: llvm/lib/Transforms/TransformInternals.h
diff -u llvm/lib/Transforms/TransformInternals.h:1.24 llvm/lib/Transforms/TransformInternals.h:1.25
--- llvm/lib/Transforms/TransformInternals.h:1.24 Wed Oct 27 11:12:24 2004
+++ llvm/lib/Transforms/TransformInternals.h Fri Jan 28 18:37:36 2005
@@ -59,6 +59,7 @@
//
class ValueMapCache;
class ValueHandle : public Instruction {
+ Use Op;
ValueMapCache &Cache;
public:
ValueHandle(ValueMapCache &VMC, Value *V);
More information about the llvm-commits
mailing list