mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-24 04:45:00 +00:00
Add support for constant expr casts
llvm-svn: 12564
This commit is contained in:
parent
b9cadcfcd9
commit
5a789b5e06
@ -571,6 +571,14 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV,
|
||||
} else if (getOpcode() == Instruction::Cast) {
|
||||
assert(getOperand(0) == From && "Cast only has one use!");
|
||||
Replacement = ConstantExpr::getCast(To, getType());
|
||||
} else if (getOpcode() == Instruction::Select) {
|
||||
Constant *C1 = getOperand(0);
|
||||
Constant *C2 = getOperand(1);
|
||||
Constant *C3 = getOperand(2);
|
||||
if (C1 == From) C1 = To;
|
||||
if (C2 == From) C2 = To;
|
||||
if (C3 == From) C3 = To;
|
||||
Replacement = ConstantExpr::getSelect(C1, C2, C3);
|
||||
} else if (getNumOperands() == 2) {
|
||||
Constant *C1 = getOperand(0);
|
||||
Constant *C2 = getOperand(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user