summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorMikael Holmen <mikael.holmen@ericsson.com>2018-06-21 10:03:34 +0000
committerMikael Holmen <mikael.holmen@ericsson.com>2018-06-21 10:03:34 +0000
commit42f7bc96dd0b541ba57d3cf0ac10a2fc13de1524 (patch)
treeb6a71a9b5f4ba5fcebeb0ea66f007dcbd441ce08 /llvm/lib/CodeGen/MachineVerifier.cpp
parentf38e631343c08bbd06ed3a0bef1ef661a343b344 (diff)
downloadbcm5719-llvm-42f7bc96dd0b541ba57d3cf0ac10a2fc13de1524.tar.gz
bcm5719-llvm-42f7bc96dd0b541ba57d3cf0ac10a2fc13de1524.zip
[DebugInfo] Make sure all DBG_VALUEs' reguse operands have IsDebug property
Summary: In some cases, these operands lacked the IsDebug property, which is meant to signal that they should not affect codegen. This patch adds a check for this property in the MachineVerifier and adds it where it was missing. This includes refactorings to use MachineInstrBuilder construction functions instead of manually setting up the intrinsic everywhere. Patch by: JesperAntonsson Reviewers: aprantl, rnk, echristo, javed.absar Reviewed By: aprantl Subscribers: qcolombet, sdardis, nemanjai, JDevlieghere, atanasyan, llvm-commits Differential Revision: https://reviews.llvm.org/D48319 llvm-svn: 335214
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index c2f5a9d4313..310316c491b 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -1204,6 +1204,10 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
return;
}
}
+ if (MI->isDebugValue() && MO->isUse() && !MO->isDebug()) {
+ report("Use-reg is not IsDebug in a DBG_VALUE", MO, MONum);
+ return;
+ }
} else {
// Virtual register.
const TargetRegisterClass *RC = MRI->getRegClassOrNull(Reg);
OpenPOWER on IntegriCloud