diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 18 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 13 |
2 files changed, 11 insertions, 20 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index d0b8a9731a3..ccf641f94d4 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -175,6 +175,12 @@ ObjCImplementationDecl::Create(ASTContext &C, DeclContext *DC, return new (C) ObjCImplementationDecl(DC, L, ClassInterface, SuperDecl); } +/// Destroy - Call destructors and release memory. +void ObjCImplementationDecl::Destroy(ASTContext& C) { + IVars.clear(); +} + + ObjCCompatibleAliasDecl * ObjCCompatibleAliasDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, @@ -250,18 +256,6 @@ FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context, return MemberDecl; } -/// ObjCAddInstanceVariablesToClassImpl - Checks for correctness of Instance -/// Variables (Ivars) relative to what declared in @implementation;s class. -/// Ivars into ObjCImplementationDecl's fields. -/// -void ObjCImplementationDecl::ObjCAddInstanceVariablesToClassImpl( - ObjCIvarDecl **ivars, unsigned numIvars) { - NumIvars = numIvars; - if (numIvars) { - Ivars = new ObjCIvarDecl*[numIvars]; - memcpy(Ivars, ivars, numIvars*sizeof(ObjCIvarDecl*)); - } -} // Get the local instance method declared in this interface. // FIXME: handle overloading, instance & class methods can have the same name. diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index b69453d4473..d91c2c1a197 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3458,13 +3458,10 @@ Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *TagD, } - // FIXME: Chain fielddecls together. - FieldDecl *NewFD; - - NewFD = FieldDecl::Create(Context, Record, - Loc, II, T, BitWidth, - D.getDeclSpec().getStorageClassSpec() == - DeclSpec::SCS_mutable); + FieldDecl *NewFD = FieldDecl::Create(Context, Record, + Loc, II, T, BitWidth, + D.getDeclSpec().getStorageClassSpec() == + DeclSpec::SCS_mutable); if (II) { NamedDecl *PrevDecl = LookupName(S, II, LookupMemberName, true); @@ -3710,7 +3707,7 @@ void Sema::ActOnFields(Scope* S, else if (ObjCImplementationDecl *IMPDecl = dyn_cast<ObjCImplementationDecl>(EnclosingDecl)) { assert(IMPDecl && "ActOnFields - missing ObjCImplementationDecl"); - IMPDecl->ObjCAddInstanceVariablesToClassImpl(ClsFields, RecFields.size()); + IMPDecl->setIVarList(ClsFields, RecFields.size()); CheckImplementationIvars(IMPDecl, ClsFields, RecFields.size(), RBrac); } } |