From c2e57bfc7f784e8f2d6026ec6b03259c1109f120 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 4 May 2009 21:10:32 +0000 Subject: [PATCH] Add ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70914 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/RecordLayout.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/clang/AST/RecordLayout.h b/include/clang/AST/RecordLayout.h index 826949e608..11001ce52a 100644 --- a/include/clang/AST/RecordLayout.h +++ b/include/clang/AST/RecordLayout.h @@ -29,14 +29,14 @@ namespace clang { /// These objects are managed by ASTContext. class ASTRecordLayout { uint64_t Size; // Size of record in bits. + uint64_t NextOffset; // Next available offset uint64_t *FieldOffsets; unsigned Alignment; // Alignment of record in bits. unsigned FieldCount; // Number of fields - unsigned NextOffset; // Next available offset friend class ASTContext; ASTRecordLayout(uint64_t S = 0, unsigned A = 8) - : Size(S), Alignment(A), FieldCount(0), NextOffset(S) {} + : Size(S), NextOffset(S), Alignment(A), FieldCount(0) {} ~ASTRecordLayout() { delete [] FieldOffsets; } @@ -78,6 +78,9 @@ public: /// getSize - Get the record size in bits. uint64_t getSize() const { return Size; } + /// getFieldCount - Get the number of fields in the layout. + unsigned getFieldCount() const { return FieldCount; } + /// getFieldOffset - Get the offset of the given field index, in /// bits. uint64_t getFieldOffset(unsigned FieldNo) const { -- 2.40.0