diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-20 03:26:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-20 03:26:33 +0000 |
commit | 0e857200bbcd846f36eb62a5feeb5a11aec035a9 (patch) | |
tree | a51b429a91ec233e4628efcd59ff6e3ac342991d /clang/lib/AST/DeclObjC.cpp | |
parent | 3fd920afcef7d8b9eb10b77ff64c75e836666168 (diff) | |
download | bcm5719-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.cpp | 13 |
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) { |