diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-05-03 10:38:35 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-03 10:38:35 +0000 |
| commit | 02f7f5f6d625a5b367f741e28b9bc7e26b9e7196 (patch) | |
| tree | 8499f738c29b2f332e4b602d4051d8c91817845b /clang/lib/AST | |
| parent | bc5a7a889428ba4d149322debca79190fb5d83ea (diff) | |
| download | bcm5719-llvm-02f7f5f6d625a5b367f741e28b9bc7e26b9e7196.tar.gz bcm5719-llvm-02f7f5f6d625a5b367f741e28b9bc7e26b9e7196.zip | |
Split out getASTObjCImplementationLayout
- The difference from getASTObjCInterfaceLayout is that the computes
the layout including synthesized ivars.
- No functionality change, they currently both compute the same thing
-- whether that includes synthesized ivars or not depends on when
they get called!!!
llvm-svn: 70690
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 0494de199f9..3342ca5bc9d 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -63,8 +63,8 @@ ASTContext::~ASTContext() { } { - llvm::DenseMap<const ObjCInterfaceDecl*, const ASTRecordLayout*>::iterator - I = ASTObjCInterfaces.begin(), E = ASTObjCInterfaces.end(); + llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>::iterator + I = ObjCLayouts.begin(), E = ObjCLayouts.end(); while (I != E) { ASTRecordLayout *R = const_cast<ASTRecordLayout*>((I++)->second); delete R; @@ -736,13 +736,16 @@ const RecordDecl *ASTContext::addRecordToClass(const ObjCInterfaceDecl *D) { return RD; } -/// getASTObjcInterfaceLayout - Get or compute information about the layout of -/// the specified Objective C, which indicates its size and ivar -/// position information. +/// getInterfaceLayoutImpl - Get or compute information about the +/// layout of the given interface. +/// +/// \param Impl - If given, also include the layout of the interface's +/// implementation. This may differ by including synthesized ivars. const ASTRecordLayout & -ASTContext::getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) { +ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, + const ObjCImplementationDecl *Impl) { // Look up this layout, if already laid out, return what we have. - const ASTRecordLayout *&Entry = ASTObjCInterfaces[D]; + const ASTRecordLayout *&Entry = ObjCLayouts[D]; if (Entry) return *Entry; // Allocate and assign into ASTRecordLayouts here. The "Entry" reference can @@ -795,6 +798,16 @@ ASTContext::getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) { return *NewEntry; } +const ASTRecordLayout & +ASTContext::getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) { + return getObjCLayout(D, 0); +} + +const ASTRecordLayout & +ASTContext::getASTObjCImplementationLayout(const ObjCImplementationDecl *D) { + return getObjCLayout(D->getClassInterface(), D); +} + /// getASTRecordLayout - Get or compute information about the layout of the /// specified record (struct/union/class), which indicates its size and field /// position information. |

