mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Make getOperandNumForIncomingValue and getOperandNumForIncomingBlock
static member functions, and add getIncomingValueNumForOperand and getIncomingBlockNumForOperand, which are the respective inverses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67522 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2004eb6272
commit
b45088cd96
@ -1942,9 +1942,13 @@ public:
|
|||||||
assert(i*2 < getNumOperands() && "Invalid value number!");
|
assert(i*2 < getNumOperands() && "Invalid value number!");
|
||||||
setOperand(i*2, V);
|
setOperand(i*2, V);
|
||||||
}
|
}
|
||||||
unsigned getOperandNumForIncomingValue(unsigned i) {
|
static unsigned getOperandNumForIncomingValue(unsigned i) {
|
||||||
return i*2;
|
return i*2;
|
||||||
}
|
}
|
||||||
|
static unsigned getIncomingValueNumForOperand(unsigned i) {
|
||||||
|
assert(i % 2 == 0 && "Invalid incoming-value operand index!");
|
||||||
|
return i/2;
|
||||||
|
}
|
||||||
|
|
||||||
/// getIncomingBlock - Return incoming basic block corresponding
|
/// getIncomingBlock - Return incoming basic block corresponding
|
||||||
/// to value use iterator
|
/// to value use iterator
|
||||||
@ -1962,9 +1966,13 @@ public:
|
|||||||
void setIncomingBlock(unsigned i, BasicBlock *BB) {
|
void setIncomingBlock(unsigned i, BasicBlock *BB) {
|
||||||
setOperand(i*2+1, BB);
|
setOperand(i*2+1, BB);
|
||||||
}
|
}
|
||||||
unsigned getOperandNumForIncomingBlock(unsigned i) {
|
static unsigned getOperandNumForIncomingBlock(unsigned i) {
|
||||||
return i*2+1;
|
return i*2+1;
|
||||||
}
|
}
|
||||||
|
static unsigned getIncomingBlockNumForOperand(unsigned i) {
|
||||||
|
assert(i % 2 == 1 && "Invalid incoming-block operand index!");
|
||||||
|
return i/2;
|
||||||
|
}
|
||||||
|
|
||||||
/// addIncoming - Add an incoming value to the end of the PHI list
|
/// addIncoming - Add an incoming value to the end of the PHI list
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user