summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-20 03:26:33 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-20 03:26:33 +0000
commit0e857200bbcd846f36eb62a5feeb5a11aec035a9 (patch)
treea51b429a91ec233e4628efcd59ff6e3ac342991d /clang/lib/AST/DeclObjC.cpp
parent3fd920afcef7d8b9eb10b77ff64c75e836666168 (diff)
downloadbcm5719-llvm-0e857200bbcd846f36eb62a5feeb5a11aec035a9.tar.gz
bcm5719-llvm-0e857200bbcd846f36eb62a5feeb5a11aec035a9.zip
Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl. llvm-svn: 55037
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index a793ac608d6..bd8b874735f 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -94,6 +94,19 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, SourceLocation L,
return new (Mem) ObjCIvarDecl(L, Id, T, ac, BW);
}
+
+ObjCAtDefsFieldDecl
+*ObjCAtDefsFieldDecl::Create(ASTContext &C, SourceLocation L,
+ IdentifierInfo *Id, QualType T, Expr *BW) {
+ void *Mem = C.getAllocator().Allocate<ObjCAtDefsFieldDecl>();
+ return new (Mem) ObjCAtDefsFieldDecl(L, Id, T, BW);
+}
+
+void ObjCAtDefsFieldDecl::Destroy(ASTContext& C) {
+ this->~ObjCAtDefsFieldDecl();
+ C.getAllocator().Deallocate((void *)this);
+}
+
ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C,
SourceLocation L,
IdentifierInfo *Id) {
OpenPOWER on IntegriCloud