From: Anders Carlsson Date: Fri, 24 Jul 2009 02:45:50 +0000 (+0000) Subject: Get rid of the size parameter to AppendField. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=728d7cd2e25a0a1e5ff272163fc7ed17980f029a;p=clang Get rid of the size parameter to AppendField. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76931 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp index af6ca82f0c..4528fc0a96 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -132,11 +132,9 @@ bool CGRecordLayoutBuilder::LayoutField(const FieldDecl *D, // 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; } @@ -186,7 +184,7 @@ void CGRecordLayoutBuilder::LayoutUnion(const RecordDecl *D) { // Now add our field. if (Ty) - AppendField(0, Size, Ty); + AppendField(0, Ty); // Append tail padding. if (Layout.getSize() / 8 > Size) @@ -216,11 +214,12 @@ bool CGRecordLayoutBuilder::LayoutFields(const RecordDecl *D) { } 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)); @@ -263,7 +262,7 @@ void CGRecordLayoutBuilder::AppendBytes(uint64_t NumBytes) { } // Append the padding field - AppendField(getNextFieldOffsetInBytes(), NumBytes, Ty); + AppendField(getNextFieldOffsetInBytes(), Ty); } uint64_t CGRecordLayoutBuilder::getNextFieldOffsetInBytes() const { diff --git a/lib/CodeGen/CGRecordLayoutBuilder.h b/lib/CodeGen/CGRecordLayoutBuilder.h index 197e4206d3..b9387856d1 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.h +++ b/lib/CodeGen/CGRecordLayoutBuilder.h @@ -97,9 +97,8 @@ class CGRecordLayoutBuilder { /// 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.