Get GEP's working with packed types. Contributed by Morten Ofstad!
authorChris Lattner <sabre@nondot.org>
Wed, 1 Dec 2004 17:12:16 +0000 (17:12 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 1 Dec 2004 17:12:16 +0000 (17:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18404 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index 48fbb50f339a5a779c6ce4ae62f9aafbae78e4d4..0496986ba0e7c4ed4ebf06688f782210a278c175 100644 (file)
@@ -151,6 +151,9 @@ bool Type::isSizedDerivedType() const {
   if (const ArrayType *ATy = dyn_cast<ArrayType>(this))
     return ATy->getElementType()->isSized();
 
+  if (const PackedType *PTy = dyn_cast<PackedType>(this))
+    return PTy->getElementType()->isSized();
+
   if (!isa<StructType>(this)) return false;
 
   // Okay, our struct is sized if all of the elements are...