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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Fri Dec 8 10:07:48 PST 2006



Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.136 -> 1.137
---
Log message:

Packed Structures

---
Diffs of the changes:  (+5 -3)

 Writer.cpp |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.136 llvm/lib/Bytecode/Writer/Writer.cpp:1.137
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.136	Wed Dec  6 19:30:31 2006
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Fri Dec  8 12:06:15 2006
@@ -197,7 +197,11 @@
 //===----------------------------------------------------------------------===//
 
 void BytecodeWriter::outputType(const Type *T) {
-  output_vbr((unsigned)T->getTypeID());
+  const StructType* STy = dyn_cast<StructType>(T);
+  if(STy && STy->isPacked())
+    output_vbr((unsigned)Type::BC_ONLY_PackedStructTyID);
+  else
+    output_vbr((unsigned)T->getTypeID());
 
   // That's all there is to handling primitive types...
   if (T->isPrimitiveType()) {
@@ -246,10 +250,8 @@
     break;
   }
 
-
   case Type::StructTyID: {
     const StructType *ST = cast<StructType>(T);
-
     // Output all of the element types...
     for (StructType::element_iterator I = ST->element_begin(),
            E = ST->element_end(); I != E; ++I) {






More information about the llvm-commits mailing list