From f5e42bfed1726607506b6502166016cb2e41fe32 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 7 Aug 2006 05:45:34 +0000 Subject: [PATCH] Add a clear method to SmallVector git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29542 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallVector.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 9b760949e95..34c915039fe 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -125,6 +125,13 @@ public: End->~T(); } + void clear() { + while (End != Begin) { + End->~T(); + --End; + } + } + /// append - Add the specified range to the end of the SmallVector. /// template -- 2.34.1