mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Simplify BranchInst::getSuccessor, avoiding a conditional operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36991 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c767844fc9
commit
b96039e4b9
@ -1323,8 +1323,7 @@ public:
|
|||||||
|
|
||||||
BasicBlock *getSuccessor(unsigned i) const {
|
BasicBlock *getSuccessor(unsigned i) const {
|
||||||
assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
|
assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
|
||||||
return (i == 0) ? cast<BasicBlock>(getOperand(0)) :
|
return cast<BasicBlock>(getOperand(i));
|
||||||
cast<BasicBlock>(getOperand(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
|
void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user