]> granicus.if.org Git - clang/commitdiff
newly factored, we can now move the set and destroy methods out of line.
authorChris Lattner <sabre@nondot.org>
Fri, 20 Feb 2009 21:16:26 +0000 (21:16 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 20 Feb 2009 21:16:26 +0000 (21:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65166 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/AST/DeclObjC.cpp

index b03936e7f439c7e621200f557f69eb27e0347587..8b05693710ffa2024d9299aecd42faa777b1933c 100644 (file)
@@ -43,24 +43,13 @@ public:
     assert(List == 0 && "Destroy should have been called before dtor");
   }
   
-  void Destroy() {
-    delete[] List;
-    NumElts = 0;
-    List = 0;
-  }
+  void Destroy();
   
   unsigned size() const { return NumElts; }
   bool empty() const { return NumElts == 0; }
   
 protected:
-  void set(void *const* InList, unsigned Elts) {
-    assert(List == 0 && "Elements already set!");
-    if (Elts == 0) return;  // Setting to an empty list is a noop.
-    
-    List = new void*[Elts];
-    NumElts = Elts;
-    memcpy(List, InList, sizeof(void*)*Elts);
-  }
+  void set(void *const* InList, unsigned Elts);
 };
   
   
index ec67f5cf40496957ae4fd4df815f3c49d2b48816..5a3c730a766f9f456d19fc0ccab969bc8d7e682a 100644 (file)
 #include "clang/AST/Stmt.h"
 using namespace clang;
 
+//===----------------------------------------------------------------------===//
+// ObjCListBase
+//===----------------------------------------------------------------------===//
+
+void ObjCListBase::Destroy() {
+  delete[] List;
+  NumElts = 0;
+  List = 0;
+}
+
+void ObjCListBase::set(void *const* InList, unsigned Elts) {
+  assert(List == 0 && "Elements already set!");
+  if (Elts == 0) return;  // Setting to an empty list is a noop.
+  
+  List = new void*[Elts];
+  NumElts = Elts;
+  memcpy(List, InList, sizeof(void*)*Elts);
+}
+
+
 //===----------------------------------------------------------------------===//
 // ObjCInterfaceDecl
 //===----------------------------------------------------------------------===//