aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer/InstructionWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-03 14:53:21 +0000
committerChris Lattner <sabre@nondot.org>2001-10-03 14:53:21 +0000
commitef9c23f2812322ae5c5f3140bfbcf92629d7ff47 (patch)
treec87db095661379f13a39bf1dee52af9ded6a23a3 /lib/Bytecode/Writer/InstructionWriter.cpp
parentda257162968820a7fd77a9df44e3f72090a7f13a (diff)
* Both Method & GlobalVariable now subclass GlobalValue
* ConstPoolPointerReference now represents a pointer to a GlobalValue * Methods name references are now explicit pointers to methods * Rename Value::GlobalVal to Value::GlobalVariableVal to avoid confusion git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/InstructionWriter.cpp')
-rw-r--r--lib/Bytecode/Writer/InstructionWriter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Bytecode/Writer/InstructionWriter.cpp b/lib/Bytecode/Writer/InstructionWriter.cpp
index 256f7c8288..d8e17e2518 100644
--- a/lib/Bytecode/Writer/InstructionWriter.cpp
+++ b/lib/Bytecode/Writer/InstructionWriter.cpp
@@ -15,6 +15,7 @@
#include "llvm/BasicBlock.h"
#include "llvm/Instruction.h"
#include "llvm/DerivedTypes.h"
+#include "llvm/iOther.h"
#include <algorithm>
typedef unsigned char uchar;
@@ -214,10 +215,11 @@ void BytecodeWriter::processInstruction(const Instruction *I) {
assert(Slots[1] != -1 && "Cast return type unknown?");
if (Slots[1] > MaxOpSlot) MaxOpSlot = Slots[1];
NumOperands++;
- } else if (I->getOpcode() == Instruction::Call && // Handle VarArg calls
- cast<MethodType>(I->getOperand(0)->getType())->isVarArg()) {
- outputInstrVarArgsCall(I, Table, Type, Out);
- return;
+ } else if (const CallInst *CI = dyn_cast<CallInst>(I)) {// Handle VarArg calls
+ if (CI->getCalledMethod()->getMethodType()->isVarArg()) {
+ outputInstrVarArgsCall(I, Table, Type, Out);
+ return;
+ }
}
// Decide which instruction encoding to use. This is determined primarily by