summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetInstrInfo.cpp
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-10-31 14:48:32 +0100
committerDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-10-31 15:34:49 +0100
commit57ee0435bd47f23f3939f402914c231b4f65ca5e (patch)
treeb1a09511e8ebf15450eefbe30f85f6f2123a7abf /llvm/lib/CodeGen/TargetInstrInfo.cpp
parent55314d323738e4a8c1890b6a6e5064e7f4e0da1c (diff)
downloadbcm5719-llvm-57ee0435bd47f23f3939f402914c231b4f65ca5e.tar.gz
bcm5719-llvm-57ee0435bd47f23f3939f402914c231b4f65ca5e.zip
[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/TargetInstrInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfo.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index 88fbfcb7784..f5f53b50ab8 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -1124,14 +1124,13 @@ Optional<ParamLoadedValue>
TargetInstrInfo::describeLoadedValue(const MachineInstr &MI) const {
const MachineFunction *MF = MI.getMF();
DIExpression *Expr = DIExpression::get(MF->getFunction().getContext(), {});
- const MachineOperand *SrcRegOp, *DestRegOp;
int64_t Offset;
- if (isCopyInstr(MI, SrcRegOp, DestRegOp)) {
- return ParamLoadedValue(*SrcRegOp, Expr);
- } else if (isAddImmediate(MI, DestRegOp, SrcRegOp, Offset)) {
+ if (auto DestSrc = isCopyInstr(MI)) {
+ return ParamLoadedValue(DestSrc->Source, Expr);
+ } else if (auto DestSrc = isAddImmediate(MI, Offset)) {
Expr = DIExpression::prepend(Expr, DIExpression::ApplyOffset, Offset);
- return ParamLoadedValue(*SrcRegOp, Expr);
+ return ParamLoadedValue(DestSrc->Source, Expr);
}
return None;
OpenPOWER on IntegriCloud