Add support for reading constantexpr select instructions

llvm-svn: 12563
This commit is contained in:
Chris Lattner 2004-03-31 02:53:59 +00:00
parent b7897ce431
commit 974efc72be
1 changed files with 3 additions and 0 deletions

View File

@ -165,6 +165,9 @@ Constant *BytecodeParser::parseConstantValue(const unsigned char *&Buf,
} else if (Opcode == Instruction::GetElementPtr) { // GetElementPtr } else if (Opcode == Instruction::GetElementPtr) { // GetElementPtr
std::vector<Constant*> IdxList(ArgVec.begin()+1, ArgVec.end()); std::vector<Constant*> IdxList(ArgVec.begin()+1, ArgVec.end());
return ConstantExpr::getGetElementPtr(ArgVec[0], IdxList); return ConstantExpr::getGetElementPtr(ArgVec[0], IdxList);
} else if (Opcode == Instruction::Select) {
assert(ArgVec.size() == 3);
return ConstantExpr::getSelect(ArgVec[0], ArgVec[1], ArgVec[2]);
} else { // All other 2-operand expressions } else { // All other 2-operand expressions
return ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]); return ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]);
} }