summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-20 21:16:26 +0000
committerChris Lattner <sabre@nondot.org>2009-02-20 21:16:26 +0000
commit4d1eb76ada7fa4834ce8adb4086ec831d8f19028 (patch)
tree85ae1070680024645e5e412a10c05ee3f10d7cae /clang/lib/AST/DeclObjC.cpp
parentf2b000c5dd3cfd8a6f1e449dacb1899c0f2ff834 (diff)
downloadbcm5719-llvm-4d1eb76ada7fa4834ce8adb4086ec831d8f19028.tar.gz
bcm5719-llvm-4d1eb76ada7fa4834ce8adb4086ec831d8f19028.zip
newly factored, we can now move the set and destroy methods out of line.
llvm-svn: 65166
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index ec67f5cf404..5a3c730a766 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -17,6 +17,26 @@
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
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud