mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-11 11:34:02 +00:00
ArrayRef ca accept one element. Simplify code a little bit, also it matches now
coding in the other places of the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176641 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
877fcf52d1
commit
b6aebf1cf3
@ -474,10 +474,12 @@ bool CallAnalyzer::visitCastInst(CastInst &I) {
|
|||||||
|
|
||||||
bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) {
|
bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) {
|
||||||
Value *Operand = I.getOperand(0);
|
Value *Operand = I.getOperand(0);
|
||||||
Constant *Ops[1] = { dyn_cast<Constant>(Operand) };
|
Constant *COp = dyn_cast<Constant>(Operand);
|
||||||
if (Ops[0] || (Ops[0] = SimplifiedValues.lookup(Operand)))
|
if (!COp)
|
||||||
|
COp = SimplifiedValues.lookup(Operand);
|
||||||
|
if (COp)
|
||||||
if (Constant *C = ConstantFoldInstOperands(I.getOpcode(), I.getType(),
|
if (Constant *C = ConstantFoldInstOperands(I.getOpcode(), I.getType(),
|
||||||
Ops, TD)) {
|
COp, TD)) {
|
||||||
SimplifiedValues[&I] = C;
|
SimplifiedValues[&I] = C;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user