aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 271cd01..53e67225 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -674,6 +674,25 @@ bool MachineInstr::isIdenticalTo(const MachineInstr &Other,
return true;
}
+bool MachineInstr::isEquivalentDbgInstr(const MachineInstr &Other) const {
+ if (!isDebugValue() || !Other.isDebugValue())
+ return false;
+ if (getDebugLoc() != Other.getDebugLoc())
+ return false;
+ if (getDebugVariable() != Other.getDebugVariable())
+ return false;
+ if (getNumDebugOperands() != Other.getNumDebugOperands())
+ return false;
+ for (unsigned OpIdx = 0; OpIdx < getNumDebugOperands(); ++OpIdx)
+ if (!getDebugOperand(OpIdx).isIdenticalTo(Other.getDebugOperand(OpIdx)))
+ return false;
+ if (!DIExpression::isEqualExpression(
+ getDebugExpression(), isIndirectDebugValue(),
+ Other.getDebugExpression(), Other.isIndirectDebugValue()))
+ return false;
+ return true;
+}
+
const MachineFunction *MachineInstr::getMF() const {
return getParent()->getParent();
}