[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Dec 1 09:14:40 PST 2004



Changes in directory llvm/lib/Target:

TargetData.cpp updated: 1.53 -> 1.54
---
Log message:

Initial support for packed types, contributed by Morten Ofstad 


---
Diffs of the changes:  (+7 -0)

Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.53 llvm/lib/Target/TargetData.cpp:1.54
--- llvm/lib/Target/TargetData.cpp:1.53	Tue Nov  2 16:18:18 2004
+++ llvm/lib/Target/TargetData.cpp	Wed Dec  1 11:14:28 2004
@@ -175,6 +175,13 @@
     Size = AlignedSize*ATy->getNumElements();
     return;
   }
+  case Type::PackedTyID: {
+    const PackedType *PTy = cast<PackedType>(Ty);
+    getTypeInfo(PTy->getElementType(), TD, Size, Alignment);
+    unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment;
+    Size = AlignedSize*PTy->getNumElements();
+    return;
+  }
   case Type::StructTyID: {
     // Get the layout annotation... which is lazily created on demand.
     const StructLayout *Layout = TD->getStructLayout(cast<StructType>(Ty));






More information about the llvm-commits mailing list