[llvm-branch-commits] [llvm-gcc-branch] r98758 - in /llvm-gcc-4.2/branches/Apple/Morbo: ./ gcc/llvm-convert.cpp

Stuart Hastings stuart at apple.com
Wed Mar 17 12:04:31 PDT 2010


Author: stuart
Date: Wed Mar 17 14:04:31 2010
New Revision: 98758

URL: http://llvm.org/viewvc/llvm-project?rev=98758&view=rev
Log:
Use GCC-specd type when referencing ObjC2 bitfields.  Radar 7639995.

Modified:
    llvm-gcc-4.2/branches/Apple/Morbo/   (props changed)
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp

Propchange: llvm-gcc-4.2/branches/Apple/Morbo/
------------------------------------------------------------------------------
    svn:mergeinfo = /llvm-gcc-4.2/trunk:98728

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp?rev=98758&r1=98757&r2=98758&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp Wed Mar 17 14:04:31 2010
@@ -7021,6 +7021,11 @@
       LVAlign = MinAlign(LVAlign, ByteOffset);
     }
 
+    // Since we're using GCC's offset, we're obliged to use GCC's
+    // "shrink-wrapped" type for the reference, lest we reference
+    // memory outside of this struct.
+    FieldTy = ConvertType(TREE_TYPE(FieldDecl));
+
     Value *Ptr = CastToType(Instruction::PtrToInt, StructAddrLV.Ptr,
                             Offset->getType());
     Ptr = Builder.CreateAdd(Ptr, Offset);





More information about the llvm-branch-commits mailing list