summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-06 06:13:34 +0000
committerChris Lattner <sabre@nondot.org>2005-05-06 06:13:34 +0000
commitfb6f1746f4c81f8c11abd55142d326a6189799fa (patch)
tree1fdbfb7123df0ecd40be1e5477a847a7be9e72d6 /llvm/lib/Bytecode/Writer/Writer.cpp
parentabb5bd78ca4b6aa1fa3f454885a56f16a074df72 (diff)
downloadbcm5719-llvm-fb6f1746f4c81f8c11abd55142d326a6189799fa.tar.gz
bcm5719-llvm-fb6f1746f4c81f8c11abd55142d326a6189799fa.zip
add bytecode reader support for tail calls
llvm-svn: 21727
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index f6d09c82201..5f614fddf08 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -606,7 +606,10 @@ void BytecodeWriter::outputInstruction(const Instruction &I) {
unsigned Opcode = I.getOpcode();
unsigned NumOperands = I.getNumOperands();
- // Encode 'volatile load' as 62 and 'volatile store' as 63.
+ // Encode 'tail call' as 61, 'volatile load' as 62, and 'volatile store' as
+ // 63.
+ if (isa<CallInst>(I) && cast<CallInst>(I).isTailCall())
+ Opcode = 61;
if (isa<LoadInst>(I) && cast<LoadInst>(I).isVolatile())
Opcode = 62;
if (isa<StoreInst>(I) && cast<StoreInst>(I).isVolatile())
OpenPOWER on IntegriCloud