[cfe-commits] r76339 - in /cfe/trunk: include/clang/AST/RecordLayout.h lib/AST/RecordLayoutBuilder.cpp lib/CodeGen/CGObjCMac.cpp
Anders Carlsson
andersca at mac.com
Sat Jul 18 14:26:44 PDT 2009
Author: andersca
Date: Sat Jul 18 16:26:44 2009
New Revision: 76339
URL: http://llvm.org/viewvc/llvm-project?rev=76339&view=rev
Log:
Rename NextOffset to DataSize, which better matches the Itanium C++ ABI
Modified:
cfe/trunk/include/clang/AST/RecordLayout.h
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Modified: cfe/trunk/include/clang/AST/RecordLayout.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecordLayout.h?rev=76339&r1=76338&r2=76339&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecordLayout.h (original)
+++ cfe/trunk/include/clang/AST/RecordLayout.h Sat Jul 18 16:26:44 2009
@@ -30,17 +30,16 @@
/// 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 @@
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;
}
};
Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=76339&r1=76338&r2=76339&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Sat Jul 18 16:26:44 2009
@@ -52,7 +52,7 @@
// 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;
}
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=76339&r1=76338&r2=76339&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sat Jul 18 16:26:44 2009
@@ -4319,7 +4319,7 @@
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())
More information about the cfe-commits
mailing list