mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 08:46:23 +00:00
Give RemoveRegOperandFromRegInfo a comment and move the
code out of line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dd1f9e4bf6
commit
3bc1a3735f
@ -427,18 +427,9 @@ private:
|
||||
/// explicitly nulled out.
|
||||
void AddRegOperandToRegInfo(MachineRegisterInfo *RegInfo);
|
||||
|
||||
void RemoveRegOperandFromRegInfo() {
|
||||
assert(isOnRegUseList() && "Reg operand is not on a use list");
|
||||
// Unlink this from the doubly linked list of operands.
|
||||
MachineOperand *NextOp = Contents.Reg.Next;
|
||||
*Contents.Reg.Prev = NextOp;
|
||||
if (NextOp) {
|
||||
assert(NextOp->getReg() == getReg() && "Corrupt reg use/def chain!");
|
||||
NextOp->Contents.Reg.Prev = Contents.Reg.Prev;
|
||||
}
|
||||
Contents.Reg.Prev = 0;
|
||||
Contents.Reg.Next = 0;
|
||||
}
|
||||
/// RemoveRegOperandFromRegInfo - Remove this register operand from the
|
||||
/// MachineRegisterInfo it is linked with.
|
||||
void RemoveRegOperandFromRegInfo();
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &OS, const MachineOperand &MO) {
|
||||
|
@ -68,6 +68,21 @@ void MachineOperand::AddRegOperandToRegInfo(MachineRegisterInfo *RegInfo) {
|
||||
*Head = this;
|
||||
}
|
||||
|
||||
/// RemoveRegOperandFromRegInfo - Remove this register operand from the
|
||||
/// MachineRegisterInfo it is linked with.
|
||||
void MachineOperand::RemoveRegOperandFromRegInfo() {
|
||||
assert(isOnRegUseList() && "Reg operand is not on a use list");
|
||||
// Unlink this from the doubly linked list of operands.
|
||||
MachineOperand *NextOp = Contents.Reg.Next;
|
||||
*Contents.Reg.Prev = NextOp;
|
||||
if (NextOp) {
|
||||
assert(NextOp->getReg() == getReg() && "Corrupt reg use/def chain!");
|
||||
NextOp->Contents.Reg.Prev = Contents.Reg.Prev;
|
||||
}
|
||||
Contents.Reg.Prev = 0;
|
||||
Contents.Reg.Next = 0;
|
||||
}
|
||||
|
||||
void MachineOperand::setReg(unsigned Reg) {
|
||||
if (getReg() == Reg) return; // No change.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user