[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu Aug 19 23:01:08 PDT 2004



Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.75 -> 1.76
---
Log message:

Packed types, brought to you by Brad Jones


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

Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.75 llvm/lib/Bytecode/Writer/Writer.cpp:1.76
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.75	Tue Aug 17 02:45:14 2004
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Fri Aug 20 01:00:57 2004
@@ -243,6 +243,16 @@
     break;
   }
 
+ case Type::PackedTyID: {
+    const PackedType *PT = cast<PackedType>(T);
+    int Slot = Table.getSlot(PT->getElementType());
+    assert(Slot != -1 && "Type used but not available!!");
+    output_typeid((unsigned)Slot);
+    output_vbr(PT->getNumElements());
+    break;
+  }
+
+
   case Type::StructTyID: {
     const StructType *ST = cast<StructType>(T);
 
@@ -339,6 +349,17 @@
     break;
   }
 
+  case Type::PackedTyID: {
+    const ConstantPacked *CP = cast<ConstantPacked>(CPV);
+
+    for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) {
+      int Slot = Table.getSlot(CP->getOperand(i));
+      assert(Slot != -1 && "Constant used but not available!!");
+      output_vbr((unsigned)Slot);
+    }
+    break;
+  }
+
   case Type::StructTyID: {
     const ConstantStruct *CPS = cast<ConstantStruct>(CPV);
 






More information about the llvm-commits mailing list