From 479ffebd732552ad70ffee7c69ae1e7b9f52cfdd Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 6 May 2005 20:42:57 +0000 Subject: encode function calling convs in the bytecode file. invoke and call are still to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21749 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bytecode/Writer/Writer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/Bytecode/Writer') diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index 63cb2d0c5a..4cf4cf5a97 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -923,10 +923,17 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) { 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); -- cgit v1.2.3-70-g09d2