Unbreak the build by putting calls to free into the implementation file and

having that implementation file #include <cstdlib>.

llvm-svn: 39952
This commit is contained in:
Reid Spencer 2007-07-17 02:16:12 +00:00
parent 20b76421ed
commit 5060fd0fa3
2 changed files with 8 additions and 4 deletions

View File

@ -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; }

View File

@ -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);
}