mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
For PR950: Implement read/write of ICmp and FCmp constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32172 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1355,14 +1355,18 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
|
||||
return Result;
|
||||
} else if (Opcode == Instruction::ICmp) {
|
||||
if (ArgVec.size() != 2)
|
||||
error("Invalid ICmp constant expr arguments");
|
||||
unsigned short pred = read_vbr_uint();
|
||||
return ConstantExpr::getICmp(pred, ArgVec[0], ArgVec[1]);
|
||||
error("Invalid ICmp constant expr arguments.");
|
||||
unsigned predicate = read_vbr_uint();
|
||||
Constant *Result = ConstantExpr::getICmp(predicate, ArgVec[0], ArgVec[1]);
|
||||
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
||||
return Result;
|
||||
} else if (Opcode == Instruction::FCmp) {
|
||||
if (ArgVec.size() != 2)
|
||||
error("Invalid FCmp constant expr arguments");
|
||||
unsigned short pred = read_vbr_uint();
|
||||
return ConstantExpr::getFCmp(pred, ArgVec[0], ArgVec[1]);
|
||||
error("Invalid FCmp constant expr arguments.");
|
||||
unsigned predicate = read_vbr_uint();
|
||||
Constant *Result = ConstantExpr::getFCmp(predicate, ArgVec[0], ArgVec[1]);
|
||||
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
||||
return Result;
|
||||
} else { // All other 2-operand expressions
|
||||
Constant* Result = ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]);
|
||||
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
||||
|
Reference in New Issue
Block a user