diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-06 07:46:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-06 07:46:13 +0000 |
commit | 05c64d149679ef624552f63a82423f850cb260eb (patch) | |
tree | 4dad7d995fdd68a061e5774f5a093fd8ddf5a475 /llvm/lib/Bytecode/Writer | |
parent | 49d1908af1e301d7e67caa7911edfd7a3c084fb0 (diff) | |
download | bcm5719-llvm-05c64d149679ef624552f63a82423f850cb260eb.tar.gz bcm5719-llvm-05c64d149679ef624552f63a82423f850cb260eb.zip |
don't misencode CC#'s
llvm-svn: 24219
Diffstat (limited to 'llvm/lib/Bytecode/Writer')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 071a41efcfe..9ba475c9d3e 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -968,12 +968,13 @@ 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 << 6) >> 6) == Slot && "Slot # too big!"); - unsigned ID = (Slot << 5) | (I->getCallingConv() & 15); + unsigned CC = I->getCallingConv()+1; + unsigned ID = (Slot << 5) | (CC & 15); if (I->isExternal()) // If external, we don't have an FunctionInfo block. ID |= 1 << 4; - if (I->getAlignment() || I->getCallingConv() & ~15) + if (I->getAlignment() || (CC & ~15) != 0) ID |= 1 << 31; // Do we need an extension word? output_vbr(ID); @@ -981,7 +982,7 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) { if (ID & (1 << 31)) { // Extension byte: bits 0-4 = alignment, bits 5-9 = top nibble of calling // convention. - ID = (Log2_32(I->getAlignment())+1) | ((I->getCallingConv() >> 4) << 5); + ID = (Log2_32(I->getAlignment())+1) | ((CC >> 4) << 5); output_vbr(ID); } } |