diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-07-17 02:16:12 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-07-17 02:16:12 +0000 |
commit | 5060fd0fa35a900f0e9f10b4fa95cd735369a2b8 (patch) | |
tree | 0bdd13f5961fcadac8f053947bc24c5bbd81bfec | |
parent | 20b76421edd2c2eced1387d1aa8bc62c404a6e86 (diff) | |
download | bcm5719-llvm-5060fd0fa35a900f0e9f10b4fa95cd735369a2b8.tar.gz bcm5719-llvm-5060fd0fa35a900f0e9f10b4fa95cd735369a2b8.zip |
Unbreak the build by putting calls to free into the implementation file and
having that implementation file #include <cstdlib>.
llvm-svn: 39952
-rw-r--r-- | llvm/include/llvm/ADT/SmallPtrSet.h | 5 | ||||
-rw-r--r-- | llvm/lib/Support/SmallPtrSet.cpp | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/SmallPtrSet.h b/llvm/include/llvm/ADT/SmallPtrSet.h index 27cc5535c1d..27c84593b1c 100644 --- a/llvm/include/llvm/ADT/SmallPtrSet.h +++ b/llvm/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/llvm/lib/Support/SmallPtrSet.cpp b/llvm/lib/Support/SmallPtrSet.cpp index 5c672375c6b..eb33c1541b0 100644 --- a/llvm/lib/Support/SmallPtrSet.cpp +++ b/llvm/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); +} |