From: Fariborz Jahanian Date: Mon, 15 Dec 2008 21:58:08 +0000 (+0000) Subject: Name of addLayoutToClass is confusing as no layout calculation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ee92e84ecf085ccbe6f877d1c6e1500961bbbce;p=clang Name of addLayoutToClass is confusing as no layout calculation is done. Layout is calculated lazily at code gen type. This patch changes the name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61054 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 333dcd3401..c9f5265542 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -386,7 +386,7 @@ public: SourceLocation RBracLoc); FieldDecl *lookupFieldDeclForIvar(ASTContext &Context, const ObjCIvarDecl *ivar); - void addLayoutToClass(ASTContext &Context); + void addRecordToClass(ASTContext &Context); void addMethods(ObjCMethodDecl **insMethods, unsigned numInsMembers, ObjCMethodDecl **clsMethods, unsigned numClsMembers, diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 50f45e8579..7e2a99fb26 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -377,10 +377,10 @@ FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context, return MemberDecl; } -/// addLayoutToClass - produces layout info. for the class for its +/// addRecordToClass - produces record info. for the class for its /// ivars and all those inherited. /// -void ObjCInterfaceDecl::addLayoutToClass(ASTContext &Context) +void ObjCInterfaceDecl::addRecordToClass(ASTContext &Context) { std::vector RecFields; CollectObjCIvars(RecFields); diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 3470cca4d1..10b1e15ae3 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -277,7 +277,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { if(!RD) { // Sometimes, class type is being directly generated in code gen for // built-in class types. - ID->addLayoutToClass(Context); + ID->addRecordToClass(Context); RD = ID->getRecordForDecl(); } return ConvertTagDeclType(cast(RD)); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 577cc7a97e..1578a253e9 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2968,7 +2968,7 @@ void Sema::ActOnFields(Scope* S, ObjCIvarDecl **ClsFields = reinterpret_cast(&RecFields[0]); if (ObjCInterfaceDecl *ID = dyn_cast(EnclosingDecl)) { ID->addInstanceVariablesToClass(ClsFields, RecFields.size(), RBrac); - ID->addLayoutToClass(Context); + ID->addRecordToClass(Context); } else if (ObjCImplementationDecl *IMPDecl = dyn_cast(EnclosingDecl)) { diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 3545eb0c0a..417803e5c1 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -588,7 +588,7 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl, /// Add implementations's ivar to the synthesize class's ivar list. if (IDecl->ImplicitInterfaceDecl()) { IDecl->addInstanceVariablesToClass(ivars, numIvars, RBrace); - IDecl->addLayoutToClass(Context); + IDecl->addRecordToClass(Context); return; } // If implementation has empty ivar list, just return.