[llvm-commits] [127320] Fix PR1417
dpatel at apple.com
dpatel at apple.com
Wed May 16 09:52:35 PDT 2007
Revision: 127320
Author: dpatel
Date: 2007-05-16 09:52:34 -0700 (Wed, 16 May 2007)
Log Message:
-----------
Fix PR1417
Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070514/049666.html
Modified Paths:
--------------
apple-local/branches/llvm/gcc/llvm-types.cpp
Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-16 09:35:42 UTC (rev 127319)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-16 16:52:34 UTC (rev 127320)
@@ -942,7 +942,9 @@
/// getLLVMType - Return the LLVM type for the specified object.
///
const Type *getLLVMType() const {
- return StructType::get(Elements, Packed || AllBitFields);
+ // Use Packed type if Packed is set or all struct fields are bitfields.
+ // Empty struct is not packed unless packed is set.
+ return StructType::get(Elements, Packed || (!Elements.empty() && AllBitFields));
}
/// getSizeAsLLVMStruct - Return the size of this struct if it were converted
More information about the llvm-commits
mailing list