diff options
author | Shengchen Kan <shengchen.kan@intel.com> | 2022-03-16 20:21:25 +0800 |
---|---|---|
committer | Shengchen Kan <shengchen.kan@intel.com> | 2022-03-16 20:25:42 +0800 |
commit | 37b378386eefab39ef570db6172a8b8e660d7bfb (patch) | |
tree | 2ea96dcb5e41e7dacc690037142c475f4d77c7b9 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 14d1a582093951973a5b94e4aab4d91ef4a0b80d (diff) | |
download | llvm-37b378386eefab39ef570db6172a8b8e660d7bfb.zip llvm-37b378386eefab39ef570db6172a8b8e660d7bfb.tar.gz llvm-37b378386eefab39ef570db6172a8b8e660d7bfb.tar.bz2 |
[NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 5481403..9015674 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -146,19 +146,13 @@ MachineRegisterInfo *MachineInstr::getRegInfo() { return nullptr; } -/// RemoveRegOperandsFromUseLists - Unlink all of the register operands in -/// this instruction from their respective use lists. This requires that the -/// operands already be on their use lists. -void MachineInstr::RemoveRegOperandsFromUseLists(MachineRegisterInfo &MRI) { +void MachineInstr::removeRegOperandsFromUseLists(MachineRegisterInfo &MRI) { for (MachineOperand &MO : operands()) if (MO.isReg()) MRI.removeRegOperandFromUseList(&MO); } -/// AddRegOperandsToUseLists - Add all of the register operands in -/// this instruction from their respective use lists. This requires that the -/// operands not be on their use lists yet. -void MachineInstr::AddRegOperandsToUseLists(MachineRegisterInfo &MRI) { +void MachineInstr::addRegOperandsToUseLists(MachineRegisterInfo &MRI) { for (MachineOperand &MO : operands()) if (MO.isReg()) MRI.addRegOperandToUseList(&MO); @@ -279,10 +273,7 @@ void MachineInstr::addOperand(MachineFunction &MF, const MachineOperand &Op) { } } -/// RemoveOperand - Erase an operand from an instruction, leaving it with one -/// fewer operand than it started with. -/// -void MachineInstr::RemoveOperand(unsigned OpNo) { +void MachineInstr::removeOperand(unsigned OpNo) { assert(OpNo < getNumOperands() && "Invalid operand number"); untieRegOperand(OpNo); @@ -1883,7 +1874,7 @@ bool MachineInstr::addRegisterKilled(Register IncomingReg, unsigned OpIdx = DeadOps.back(); if (getOperand(OpIdx).isImplicit() && (!isInlineAsm() || findInlineAsmFlagIdx(OpIdx) < 0)) - RemoveOperand(OpIdx); + removeOperand(OpIdx); else getOperand(OpIdx).setIsKill(false); DeadOps.pop_back(); @@ -1948,7 +1939,7 @@ bool MachineInstr::addRegisterDead(Register Reg, unsigned OpIdx = DeadOps.back(); if (getOperand(OpIdx).isImplicit() && (!isInlineAsm() || findInlineAsmFlagIdx(OpIdx) < 0)) - RemoveOperand(OpIdx); + removeOperand(OpIdx); else getOperand(OpIdx).setIsDead(false); DeadOps.pop_back(); |