diff options
-rw-r--r-- | include/llvm/ADT/SmallPtrSet.h | 5 | ||||
-rw-r--r-- | lib/Support/SmallPtrSet.cpp | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index 27cc553..27c8459 100644 --- a/include/llvm/ADT/SmallPtrSet.h +++ b/include/llvm/ADT/SmallPtrSet.h @@ -67,10 +67,7 @@ public: CurArray[SmallSize] = 0; clear(); } - ~SmallPtrSetImpl() { - if (!isSmall()) - free(CurArray); - } + ~SmallPtrSetImpl(); bool empty() const { return size() == 0; } unsigned size() const { return NumElements; } diff --git a/lib/Support/SmallPtrSet.cpp b/lib/Support/SmallPtrSet.cpp index 5c67237..eb33c15 100644 --- a/lib/Support/SmallPtrSet.cpp +++ b/lib/Support/SmallPtrSet.cpp @@ -14,6 +14,8 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/MathExtras.h" +#include <cstdlib> + using namespace llvm; bool SmallPtrSetImpl::insert(void *Ptr) { @@ -200,3 +202,8 @@ void SmallPtrSetImpl::CopyFrom(const SmallPtrSetImpl &RHS) { // Copy over the contents from the other set memcpy(CurArray, RHS.CurArray, sizeof(void*)*(CurArraySize+1)); } + +SmallPtrSetImpl::~SmallPtrSetImpl() { + if (!isSmall()) + free(CurArray); +} |