Add support for the new va_arg instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-05-08 02:44:12 +00:00
parent 97b315a585
commit 8f77daef04
7 changed files with 30 additions and 11 deletions

View File

@ -130,11 +130,15 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
Value *V;
switch (Raw.Opcode) {
case Instruction::VarArg:
case Instruction::Cast: {
V = getValue(Raw.Ty, Raw.Arg1);
const Type *Ty = getType(Raw.Arg2);
if (V == 0 || Ty == 0) { std::cerr << "Invalid cast!\n"; return true; }
Res = new CastInst(V, Ty);
if (Raw.Opcode == Instruction::Cast)
Res = new CastInst(V, Ty);
else
Res = new VarArgInst(V, Ty);
return false;
}
case Instruction::PHINode: {