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

Chris Lattner lattner at cs.uiuc.edu
Fri May 6 13:43:12 PDT 2005



Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.101 -> 1.102
---
Log message:

encode function calling convs in the bytecode file.  invoke and call are 
still to come.


---
Diffs of the changes:  (+8 -1)

 Writer.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.101 llvm/lib/Bytecode/Writer/Writer.cpp:1.102
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.101	Fri May  6 15:27:03 2005
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Fri May  6 15:42:57 2005
@@ -923,10 +923,17 @@
     assert(Slot != -1 && "Module slot calculator is broken!");
     assert(Slot >= Type::FirstDerivedTyID && "Derived type not in range!");
     assert(((Slot << 5) >> 5) == Slot && "Slot # too big!");
-    unsigned ID = (Slot << 5) + 1;
+    unsigned ID = (Slot << 5);
+
+    if (I->getCallingConv() < 15)
+      ID += I->getCallingConv()+1;
+
     if (I->isExternal())   // If external, we don't have an FunctionInfo block.
       ID |= 1 << 4;
     output_vbr(ID);
+
+    if (I->getCallingConv() >= 15)
+      output_vbr(I->getCallingConv());
   }
   output_vbr((unsigned)Table.getSlot(Type::VoidTy) << 5);
 






More information about the llvm-commits mailing list