diff options
author | Jakub Staszak <kubastaszak@gmail.com> | 2013-03-07 20:01:19 +0000 |
---|---|---|
committer | Jakub Staszak <kubastaszak@gmail.com> | 2013-03-07 20:01:19 +0000 |
commit | b6aebf1cf31232d6b5d4f5060a2ee9fcdbfc6f03 (patch) | |
tree | 0cc6a5bea0326b02a8e03384a3eeba71d1db87f3 /lib/Analysis/IPA | |
parent | 877fcf52d17f1cadc38112ca988cdd4e666bac24 (diff) |
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
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r-- | lib/Analysis/IPA/InlineCost.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Analysis/IPA/InlineCost.cpp b/lib/Analysis/IPA/InlineCost.cpp index 3292e003f5..35c45e6180 100644 --- a/lib/Analysis/IPA/InlineCost.cpp +++ b/lib/Analysis/IPA/InlineCost.cpp @@ -474,10 +474,12 @@ bool CallAnalyzer::visitCastInst(CastInst &I) { bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) { Value *Operand = I.getOperand(0); - Constant *Ops[1] = { dyn_cast<Constant>(Operand) }; - if (Ops[0] || (Ops[0] = SimplifiedValues.lookup(Operand))) + Constant *COp = dyn_cast<Constant>(Operand); + if (!COp) + COp = SimplifiedValues.lookup(Operand); + if (COp) if (Constant *C = ConstantFoldInstOperands(I.getOpcode(), I.getType(), - Ops, TD)) { + COp, TD)) { SimplifiedValues[&I] = C; return true; } |