summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-06 20:42:57 +0000
committerChris Lattner <sabre@nondot.org>2005-05-06 20:42:57 +0000
commitf2e1c1969fdb840502d2ac0f0454cc0ffcffff5b (patch)
tree34c1d299eeff6e47548a76a17479d13e0970bb36 /llvm/lib/Bytecode/Writer/Writer.cpp
parent53bdd312111fe09f2c9cfc4950b91d467b0cf436 (diff)
downloadbcm5719-llvm-f2e1c1969fdb840502d2ac0f0454cc0ffcffff5b.tar.gz
bcm5719-llvm-f2e1c1969fdb840502d2ac0f0454cc0ffcffff5b.zip
encode function calling convs in the bytecode file. invoke and call are
still to come. llvm-svn: 21749
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index 63cb2d0c5a1..4cf4cf5a97d 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud