// Append padding if necessary.
AppendPadding(FieldOffsetInBytes, Ty);
- uint64_t FieldSizeInBytes = getTypeSizeInBytes(Ty);
-
// Now append the field.
LLVMFields.push_back(LLVMFieldInfo(D, FieldTypes.size()));
- AppendField(FieldOffsetInBytes, FieldSizeInBytes, Ty);
+ AppendField(FieldOffsetInBytes, Ty);
return true;
}
// Now add our field.
if (Ty)
- AppendField(0, Size, Ty);
+ AppendField(0, Ty);
// Append tail padding.
if (Layout.getSize() / 8 > Size)
}
void CGRecordLayoutBuilder::AppendField(uint64_t FieldOffsetInBytes,
- uint64_t FieldSizeInBytes,
const llvm::Type *FieldTy) {
AlignmentAsLLVMStruct = std::max(AlignmentAsLLVMStruct,
getTypeAlignment(FieldTy));
-
+
+ uint64_t FieldSizeInBytes = getTypeSizeInBytes(FieldTy);
+
FieldTypes.push_back(FieldTy);
FieldInfos.push_back(FieldInfo(FieldOffsetInBytes, FieldSizeInBytes));
}
// Append the padding field
- AppendField(getNextFieldOffsetInBytes(), NumBytes, Ty);
+ AppendField(getNextFieldOffsetInBytes(), Ty);
}
uint64_t CGRecordLayoutBuilder::getNextFieldOffsetInBytes() const {
/// LayoutBitField - layout a single bit field.
void LayoutBitField(const FieldDecl *D, uint64_t FieldOffset);
- /// AppendField - Appends a field with the given offset size and type.
- void AppendField(uint64_t FieldOffsetInBytes, uint64_t FieldSizeInBytes,
- const llvm::Type *FieldTy);
+ /// AppendField - Appends a field with the given offset and type.
+ void AppendField(uint64_t FieldOffsetInBytes, const llvm::Type *FieldTy);
/// AppendPadding - Appends enough padding bytes so that the total struct
/// size matches the alignment of the passed in type.