[llvm-commits] [llvm] r49622 - in /llvm/branches/ggreif/use-diet: include/llvm/Instructions.h include/llvm/Use.h lib/VMCore/Use.cpp
Gabor Greif
ggreif at gmail.com
Sun Apr 13 14:15:11 PDT 2008
Author: ggreif
Date: Sun Apr 13 16:15:09 2008
New Revision: 49622
URL: http://llvm.org/viewvc/llvm-project?rev=49622&view=rev
Log:
correctly zap uses in ReturnInst::operator delete
Modified:
llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
llvm/branches/ggreif/use-diet/include/llvm/Use.h
llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp
Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49622&r1=49621&r2=49622&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Sun Apr 13 16:15:09 2008
@@ -1649,8 +1649,10 @@
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ReturnInst, Value)
void ReturnInst::operator delete(void *it) {
- assert(0 && "ReturnInst::operator delete");
- ::operator delete(OperandTraits<ReturnInst>::op_begin(static_cast<ReturnInst*>(it)));
+ ReturnInst* me(static_cast<ReturnInst*>(it));
+ Use::zap(OperandTraits<ReturnInst>::op_begin(me),
+ OperandTraits<ReturnInst>::op_end(me),
+ true);
}
//===----------------------------------------------------------------------===//
Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49622&r1=49621&r2=49622&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Sun Apr 13 16:15:09 2008
@@ -55,7 +55,7 @@
User *getUser() const;
const Use* getImpliedUser() const;
static void initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0);
- static void zap(Use *Start, const Use *Stop);
+ static void zap(Use *Start, const Use *Stop, bool del = false);
inline void set(Value *Val);
Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49622&r1=49621&r2=49622&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Sun Apr 13 16:15:09 2008
@@ -75,10 +75,12 @@
// Use zap Implementation
//===----------------------------------------------------------------------===//
-void Use::zap(Use *Start, const Use *Stop) {
+void Use::zap(Use *Start, const Use *Stop, bool del) {
while (Start != Stop) {
- (Start++)->set(0);
+ (--Stop)->set(0);
}
+ if (del)
+ ::operator delete(Start);
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list