summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>2018-08-30 07:17:41 +0000
committerCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>2018-08-30 07:17:41 +0000
commit06adfa17188859cab229fb977ec9dfe2b7dce6ed (patch)
tree9348bc5460adbdc996e97263c50285446b87998d /llvm/lib/CodeGen/MachineInstr.cpp
parent62f7a3207b2f1a78afc9dbbfe20f4327f7283020 (diff)
downloadbcm5719-llvm-06adfa17188859cab229fb977ec9dfe2b7dce6ed.tar.gz
bcm5719-llvm-06adfa17188859cab229fb977ec9dfe2b7dce6ed.zip
[DWARF] Missing location debug information with -O2.
Check that Machine CSE correctly handles during the transformation, the debug location information for local variables. Differential Revision: https://reviews.llvm.org/D50887 llvm-svn: 341025
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 55dbbd37b4d..d004fa9b76a 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -2031,3 +2031,20 @@ void llvm::updateDbgValueForSpill(MachineInstr &Orig, int FrameIndex) {
Orig.getOperand(1).ChangeToImmediate(0U);
Orig.getOperand(3).setMetadata(Expr);
}
+
+void MachineInstr::collectDebugValues(
+ SmallVectorImpl<MachineInstr *> &DbgValues) {
+ MachineInstr &MI = *this;
+ if (!MI.getOperand(0).isReg())
+ return;
+
+ MachineBasicBlock::iterator DI = MI; ++DI;
+ for (MachineBasicBlock::iterator DE = MI.getParent()->end();
+ DI != DE; ++DI) {
+ if (!DI->isDebugValue())
+ return;
+ if (DI->getOperand(0).isReg() &&
+ DI->getOperand(0).getReg() == MI.getOperand(0).getReg())
+ DbgValues.push_back(&*DI);
+ }
+}
OpenPOWER on IntegriCloud