aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-07-24 02:45:50 +0000
committerAnders Carlsson <andersca@mac.com>2009-07-24 02:45:50 +0000
commit728d7cd2e25a0a1e5ff272163fc7ed17980f029a (patch)
treefce9797b97e6160bd7f0782dce18d653aa002a56 /lib/CodeGen/CGRecordLayoutBuilder.cpp
parent3111218bc7ec7ff8b0ab8fdd15a6949904ef698e (diff)
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
Diffstat (limited to 'lib/CodeGen/CGRecordLayoutBuilder.cpp')
-rw-r--r--lib/CodeGen/CGRecordLayoutBuilder.cpp13
1 files changed, 6 insertions, 7 deletions
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 {