From 4213188c7543af37414dee3702e123b36694ab2a Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sun, 28 Dec 2008 21:57:02 +0000 Subject: [PATCH] Forgot to commit this file. Add a clear() method to remove all ranges and value numbers for a live interval. llvm-svn: 61459 --- llvm/include/llvm/CodeGen/LiveInterval.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h index 880d541e50b2..86aada3b80a7 100644 --- a/llvm/include/llvm/CodeGen/LiveInterval.h +++ b/llvm/include/llvm/CodeGen/LiveInterval.h @@ -145,6 +145,16 @@ namespace llvm { while (I->end <= Pos) ++I; return I; } + + void clear() { + while (!valnos.empty()) { + VNInfo *VNI = valnos.back(); + valnos.pop_back(); + VNI->~VNInfo(); + } + + ranges.clear(); + } /// isStackSlot - Return true if this is a stack slot interval. ///