diff options
author | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-11-09 09:42:10 +0000 |
---|---|---|
committer | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-11-09 09:42:10 +0000 |
commit | fa9cf897347c456313834672a54386baca2e8b77 (patch) | |
tree | fb2f9860590ea8f6f0cb9c6c0312fe11f713598e /llvm/lib/IR/Instruction.cpp | |
parent | 08979cd1250bfea14f9798bd6d153e0debda6e81 (diff) | |
download | bcm5719-llvm-fa9cf897347c456313834672a54386baca2e8b77.tar.gz bcm5719-llvm-fa9cf897347c456313834672a54386baca2e8b77.zip |
[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG.
In SimplifyCFG when given a conditional branch that goes to BB1 and BB2, the hoisted common terminator instruction in the two blocks, caused debug line records associated with subsequent select instructions to become ambiguous. It causes the debugger to display unreachable source lines.
Differential Revision: https://reviews.llvm.org/D53390
llvm-svn: 346481
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r-- | llvm/lib/IR/Instruction.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp index 75e7413a47d..1e326370318 100644 --- a/llvm/lib/IR/Instruction.cpp +++ b/llvm/lib/IR/Instruction.cpp @@ -602,6 +602,13 @@ const Instruction *Instruction::getNextNonDebugInstruction() const { return nullptr; } +const Instruction *Instruction::getPrevNonDebugInstruction() const { + for (const Instruction *I = getPrevNode(); I; I = I->getPrevNode()) + if (!isa<DbgInfoIntrinsic>(I)) + return I; + return nullptr; +} + bool Instruction::isAssociative() const { unsigned Opcode = getOpcode(); if (isAssociative(Opcode)) |