mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
Further fixes for PR93
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9738 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
01f93a4712
commit
d981f8af79
@ -318,13 +318,19 @@ static Value *RemapOperand(const Value *In,
|
||||
assert(CE->getOpcode() == Instruction::Cast);
|
||||
Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
|
||||
} else if (CE->getOpcode() == Instruction::Shl ||
|
||||
CE->getOpcode() == Instruction::Shr) { // Shift
|
||||
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
|
||||
Result = ConstantExpr::getShift(CE->getOpcode(), cast<Constant>(V1),
|
||||
cast<Constant>(V2));
|
||||
} else if (CE->getNumOperands() == 2) {
|
||||
// Binary operator...
|
||||
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
|
||||
|
||||
Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(V1),
|
||||
cast<Constant>(V2));
|
||||
cast<Constant>(V2));
|
||||
} else {
|
||||
assert(0 && "Unknown constant expr type!");
|
||||
}
|
||||
|
@ -318,13 +318,19 @@ static Value *RemapOperand(const Value *In,
|
||||
assert(CE->getOpcode() == Instruction::Cast);
|
||||
Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
|
||||
} else if (CE->getOpcode() == Instruction::Shl ||
|
||||
CE->getOpcode() == Instruction::Shr) { // Shift
|
||||
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
|
||||
Result = ConstantExpr::getShift(CE->getOpcode(), cast<Constant>(V1),
|
||||
cast<Constant>(V2));
|
||||
} else if (CE->getNumOperands() == 2) {
|
||||
// Binary operator...
|
||||
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
|
||||
|
||||
Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(V1),
|
||||
cast<Constant>(V2));
|
||||
cast<Constant>(V2));
|
||||
} else {
|
||||
assert(0 && "Unknown constant expr type!");
|
||||
}
|
||||
|
@ -318,13 +318,19 @@ static Value *RemapOperand(const Value *In,
|
||||
assert(CE->getOpcode() == Instruction::Cast);
|
||||
Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
|
||||
} else if (CE->getOpcode() == Instruction::Shl ||
|
||||
CE->getOpcode() == Instruction::Shr) { // Shift
|
||||
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
|
||||
Result = ConstantExpr::getShift(CE->getOpcode(), cast<Constant>(V1),
|
||||
cast<Constant>(V2));
|
||||
} else if (CE->getNumOperands() == 2) {
|
||||
// Binary operator...
|
||||
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
|
||||
Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
|
||||
|
||||
Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(V1),
|
||||
cast<Constant>(V2));
|
||||
cast<Constant>(V2));
|
||||
} else {
|
||||
assert(0 && "Unknown constant expr type!");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user