From: Reid Spencer Date: Tue, 17 Jul 2007 02:16:12 +0000 (+0000) Subject: Unbreak the build by putting calls to free into the implementation file and X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=845b31de0c58e1f667063170191262079d311052;p=oota-llvm.git Unbreak the build by putting calls to free into the implementation file and having that implementation file #include . git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39952 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index 27cc5535c1d..27c84593b1c 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 5c672375c6b..eb33c1541b0 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 + 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); +}