summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/SmallPtrSet.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-07-17 02:16:12 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-07-17 02:16:12 +0000
commit5060fd0fa35a900f0e9f10b4fa95cd735369a2b8 (patch)
tree0bdd13f5961fcadac8f053947bc24c5bbd81bfec /llvm/lib/Support/SmallPtrSet.cpp
parent20b76421edd2c2eced1387d1aa8bc62c404a6e86 (diff)
downloadbcm5719-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
Diffstat (limited to 'llvm/lib/Support/SmallPtrSet.cpp')
-rw-r--r--llvm/lib/Support/SmallPtrSet.cpp7
1 files changed, 7 insertions, 0 deletions
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);
+}
OpenPOWER on IntegriCloud