[llvm-commits] [llvm-gcc-4.2] r50552 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Chris Lattner
sabre at nondot.org
Thu May 1 16:09:42 PDT 2008
Author: lattner
Date: Thu May 1 18:09:41 2008
New Revision: 50552
URL: http://llvm.org/viewvc/llvm-project?rev=50552&view=rev
Log:
Use the correct way to size a struct field, this fixes a few GCC C++ regression
test failures.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=50552&r1=50551&r2=50552&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Thu May 1 18:09:41 2008
@@ -1843,9 +1843,9 @@
// time we support this is when the LLVM type is a struct. In this case, we
// remove entries from the end of the LLVM struct until the size matches what
// the RTL backend expects as the size for the field.
+ uint64_t LLVMSize = Info.TD.getABITypeSizeInBits(Ty);
if (DECL_SIZE(Field) && isInt64(DECL_SIZE(Field), true) &&
- getInt64(DECL_SIZE(Field), true) != Info.getTypeSize(Ty)*8) {
- uint64_t LLVMSize = Info.getTypeSize(Ty)*8;
+ getInt64(DECL_SIZE(Field), true) != LLVMSize) {
uint64_t GCCFieldSize = getInt64(DECL_SIZE(Field), true);
tree FieldType = TREE_TYPE(Field);
assert(getInt64(TYPE_SIZE(FieldType), true) == LLVMSize &&
More information about the llvm-commits
mailing list