summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit7fac070215c8d4fd4a41ae58750e6c1faef4931f (patch)
tree65568c242ce17aae14e6f3319ae88b056aa1f474 /llvm/lib/Bytecode/Writer/InstructionWriter.cpp
parent23356658b3a2dba4126d82e8e062585ad83f1b20 (diff)
downloadbcm5719-llvm-7fac070215c8d4fd4a41ae58750e6c1faef4931f.tar.gz
bcm5719-llvm-7fac070215c8d4fd4a41ae58750e6c1faef4931f.zip
* 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 llvm-svn: 703
Diffstat (limited to 'llvm/lib/Bytecode/Writer/InstructionWriter.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/InstructionWriter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp
index 256f7c82889..d8e17e25187 100644
--- a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud