summaryrefslogtreecommitdiff
path: root/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
commit845b31de0c58e1f667063170191262079d311052 (patch)
tree1a296211604a0f0f898c529c2afc02c4ced1a61f /lib/Support/SmallPtrSet.cpp
parenta8b9a7b92468af001e517d68be22fe41ef4d15e1 (diff)
downloadllvm-845b31de0c58e1f667063170191262079d311052.tar.gz
llvm-845b31de0c58e1f667063170191262079d311052.tar.bz2
llvm-845b31de0c58e1f667063170191262079d311052.tar.xz
Unbreak the build by putting calls to free into the implementation file and
having that implementation file #include <cstdlib>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SmallPtrSet.cpp')
-rw-r--r--lib/Support/SmallPtrSet.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/SmallPtrSet.cpp b/lib/Support/SmallPtrSet.cpp
index 5c672375c6..eb33c1541b 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);
+}