Unbreak the build by putting calls to free into the implementation file and
authorReid Spencer <rspencer@reidspencer.com>
Tue, 17 Jul 2007 02:16:12 +0000 (02:16 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 17 Jul 2007 02:16:12 +0000 (02:16 +0000)
having that implementation file #include <cstdlib>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39952 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallPtrSet.h
lib/Support/SmallPtrSet.cpp

index 27cc5535c1da18f90580bf9c4003911e6851bfc7..27c84593b1c6756a029ecc8f327f543307fced56 100644 (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; }
index 5c672375c6b74e37c0a2900f99d165ab5fcdc51b..eb33c1541b080aad31e6795ad102f90395af8a31 100644 (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);
+}