[cfe-commits] r76931 - in /cfe/trunk/lib/CodeGen: CGRecordLayoutBuilder.cpp CGRecordLayoutBuilder.h

Anders Carlsson andersca at mac.com
Thu Jul 23 19:46:26 PDT 2009


Author: andersca
Date: Thu Jul 23 21:45:50 2009
New Revision: 76931

URL: http://llvm.org/viewvc/llvm-project?rev=76931&view=rev
Log:
Get rid of the size parameter to AppendField. No functionality change.

Modified:
    cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
    cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.h

Modified: cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp?rev=76931&r1=76930&r2=76931&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp Thu Jul 23 21:45:50 2009
@@ -132,11 +132,9 @@
   // 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 @@
   
   // 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 @@
 }
 
 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 @@
   }
   
   // Append the padding field
-  AppendField(getNextFieldOffsetInBytes(), NumBytes, Ty);
+  AppendField(getNextFieldOffsetInBytes(), Ty);
 }
 
 uint64_t CGRecordLayoutBuilder::getNextFieldOffsetInBytes() const {

Modified: cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.h?rev=76931&r1=76930&r2=76931&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.h (original)
+++ cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.h Thu Jul 23 21:45:50 2009
@@ -97,9 +97,8 @@
   /// 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.





More information about the cfe-commits mailing list