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


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to