]> granicus.if.org Git - clang/commitdiff
Rename NextOffset to DataSize, which better matches the Itanium C++ ABI
authorAnders Carlsson <andersca@mac.com>
Sat, 18 Jul 2009 21:26:44 +0000 (21:26 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 18 Jul 2009 21:26:44 +0000 (21:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76339 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/RecordLayout.h
lib/AST/RecordLayoutBuilder.cpp
lib/CodeGen/CGObjCMac.cpp

index 88955be80e055b870b4270769d5712d38e2689b8..b7ae9c1cdcf6547c09630369cc01125b7b4ccfc1 100644 (file)
@@ -30,17 +30,16 @@ 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 DataSize;    // Size of record in bits without tail padding.
   uint64_t *FieldOffsets;
   unsigned Alignment;   // Alignment of record in bits.
   unsigned FieldCount;  // Number of fields
   friend class ASTContext;
   friend class ASTRecordLayoutBuilder;
 
-  ASTRecordLayout(uint64_t Size, unsigned Alignment,
-                  unsigned nextoffset,
+  ASTRecordLayout(uint64_t size, unsigned alignment, unsigned datasize,
                   const uint64_t *fieldoffsets, unsigned fieldcount) 
-  : Size(Size), NextOffset(nextoffset), FieldOffsets(0), Alignment(Alignment), 
+  : Size(size), DataSize(datasize), FieldOffsets(0), Alignment(alignment),
     FieldCount(fieldcount) {
     if (FieldCount > 0)  {
       FieldOffsets = new uint64_t[FieldCount];
@@ -72,10 +71,10 @@ public:
     return FieldOffsets[FieldNo];
   }
     
-  /// getNextOffset - Get the next available (unused) offset in the
-  /// structure, in bits.
-  uint64_t getNextOffset() const {
-    return NextOffset;
+  /// getDataSize() - Get the record data size, which is the record size
+  /// without tail padding, in bits.
+  uint64_t getDataSize() const {
+    return DataSize;
   }
 };
 
index 5230ba95d1db2babb3ff20cf3a9ebd79596e2e7f..f4257b7d0ef2a9d4502841c896f4edb5e916babf 100644 (file)
@@ -52,7 +52,7 @@ void ASTRecordLayoutBuilder::Layout(const ObjCInterfaceDecl *D,
     
     // We start laying out ivars not at the end of the superclass
     // structure, but at the next byte following the last field.
-    Size = llvm::RoundUpToAlignment(SL.NextOffset, 8);
+    Size = llvm::RoundUpToAlignment(SL.getDataSize(), 8);
     NextOffset = Size;
   }
   
index 9b9cec661efa7cba654261615680c312f71be2a0..7252de6ec67099d2ea80568bbd6fc7cb4d0927b6 100644 (file)
@@ -4319,7 +4319,7 @@ void CGObjCNonFragileABIMac::GetClassSizeInfo(const ObjCImplementationDecl *OID,
     CGM.getContext().getASTObjCImplementationLayout(OID);
   
   // InstanceSize is really instance end.
-  InstanceSize = llvm::RoundUpToAlignment(RL.getNextOffset(), 8) / 8;
+  InstanceSize = llvm::RoundUpToAlignment(RL.getDataSize(), 8) / 8;
 
   // If there are no fields, the start is the same as the end.
   if (!RL.getFieldCount())