[llvm-commits] [llvm-gcc-4.2] r73205 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Dale Johannesen dalej at apple.com
Thu Jun 11 13:47:34 PDT 2009


Author: johannes
Date: Thu Jun 11 15:47:34 2009
New Revision: 73205

URL: http://llvm.org/viewvc/llvm-project?rev=73205&view=rev
Log:
Make sure converting a ComponentRef within a Constant returns
a result of the right type, as does a convert of a
normal ComponentRef.  PR 4349.


Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=73205&r1=73204&r2=73205&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Jun 11 15:47:34 2009
@@ -7529,8 +7529,9 @@
     Ptr = TheFolder->CreateAdd(Ptr, Offset);
     FieldPtr = TheFolder->CreateIntToPtr(Ptr, PointerType::getUnqual(FieldTy));
   }
-  
-  if (isBitfield(FieldDecl))
+
+  // Make sure we return a result of the right type.
+  if (PointerType::getUnqual(FieldTy) != FieldPtr->getType())
     FieldPtr = TheFolder->CreateBitCast(FieldPtr,
                                         PointerType::getUnqual(FieldTy));
 





More information about the llvm-commits mailing list