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

Chris Lattner lattner at cs.uiuc.edu
Wed May 7 21:45:03 PDT 2003


Changes in directory llvm/lib/Bytecode/Writer:

WriteInst.cpp updated: 1.27 -> 1.28

---
Log message:

Add support for the new va_arg instruction



---
Diffs of the changes:

Index: llvm/lib/Bytecode/Writer/WriteInst.cpp
diff -u llvm/lib/Bytecode/Writer/WriteInst.cpp:1.27 llvm/lib/Bytecode/Writer/WriteInst.cpp:1.28
--- llvm/lib/Bytecode/Writer/WriteInst.cpp:1.27	Tue Jan 21 14:13:49 2003
+++ llvm/lib/Bytecode/Writer/WriteInst.cpp	Wed May  7 21:44:07 2003
@@ -35,7 +35,7 @@
   output_vbr(Type, Out);                         // Result type
 
   unsigned NumArgs = I->getNumOperands();
-  output_vbr(NumArgs + isa<CastInst>(I), Out);
+  output_vbr(NumArgs + (isa<CastInst>(I) || isa<VarArgInst>(I)), Out);
 
   for (unsigned i = 0; i < NumArgs; ++i) {
     int Slot = Table.getValSlot(I->getOperand(i));
@@ -43,9 +43,9 @@
     output_vbr((unsigned)Slot, Out);
   }
 
-  if (isa<CastInst>(I)) {
+  if (isa<CastInst>(I) || isa<VarArgInst>(I)) {
     int Slot = Table.getValSlot(I->getType());
-    assert(Slot != -1 && "Cast return type unknown?");
+    assert(Slot != -1 && "Cast/VarArg return type unknown?");
     output_vbr((unsigned)Slot, Out);
   }
 
@@ -218,7 +218,7 @@
   if (Slot > MaxOpSlot) MaxOpSlot = Slot;
 
   // Handle the special case for cast...
-  if (isa<CastInst>(I)) {
+  if (isa<CastInst>(I) || isa<VarArgInst>(I)) {
     // Cast has to encode the destination type as the second argument in the
     // packet, or else we won't know what type to cast to!
     Slots[1] = Table.getValSlot(I.getType());





More information about the llvm-commits mailing list