diff options
author | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-11-08 11:19:58 +0100 |
---|---|---|
committer | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-11-08 13:00:39 +0100 |
commit | 8d2ccd1ac32ca5c96fc17e265fec5e1fc94a0520 (patch) | |
tree | 47d5d4208f93b04b62dbcb6113764d68b1a033ac /llvm/lib/CodeGen/LiveDebugValues.cpp | |
parent | 5a1bac4d1daee2bcbf13365a8254a26d242d8c46 (diff) | |
download | llvm-8d2ccd1ac32ca5c96fc17e265fec5e1fc94a0520.zip llvm-8d2ccd1ac32ca5c96fc17e265fec5e1fc94a0520.tar.gz llvm-8d2ccd1ac32ca5c96fc17e265fec5e1fc94a0520.tar.bz2 |
Reland: [TII] Use optional destination and source pair as a return value; NFC
Refactor usage of isCopyInstrImpl, isCopyInstr and isAddImmediate methods
to return optional machine operand pair of destination and source
registers.
Patch by Nikola Prica
Differential Revision: https://reviews.llvm.org/D69622
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp index b15c594..56fbdff 100644 --- a/llvm/lib/CodeGen/LiveDebugValues.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues.cpp @@ -997,10 +997,14 @@ void LiveDebugValues::transferRegisterCopy(MachineInstr &MI, OpenRangesSet &OpenRanges, VarLocMap &VarLocIDs, TransferMap &Transfers) { - const MachineOperand *SrcRegOp, *DestRegOp; - if (!TII->isCopyInstr(MI, SrcRegOp, DestRegOp) || !SrcRegOp->isKill() || - !DestRegOp->isDef()) + auto DestSrc = TII->isCopyInstr(MI); + if (!DestSrc) + return; + + const MachineOperand *DestRegOp = DestSrc->Destination; + const MachineOperand *SrcRegOp = DestSrc->Source; + if (!SrcRegOp->isKill() || !DestRegOp->isDef()) return; auto isCalleeSavedReg = [&](unsigned Reg) { |