diff options
author | Nikola Prica <nikola.prica@rt-rk.com> | 2019-06-10 08:41:06 +0000 |
---|---|---|
committer | Nikola Prica <nikola.prica@rt-rk.com> | 2019-06-10 08:41:06 +0000 |
commit | abc1dff7e44a9eed6c2cc9a7d9ee366fbe4abcf7 (patch) | |
tree | 53da99a08fdde1c13ce220bc8ca0b9628a371507 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | 44d908d743d2e42206a8884ab2dea35cd29bb2da (diff) | |
download | llvm-abc1dff7e44a9eed6c2cc9a7d9ee366fbe4abcf7.zip llvm-abc1dff7e44a9eed6c2cc9a7d9ee366fbe4abcf7.tar.gz llvm-abc1dff7e44a9eed6c2cc9a7d9ee366fbe4abcf7.tar.bz2 |
[DebugInfo] More strict debug range for stack variables
Variable's stack location can stretch longer than it should. If a
variable is placed at the stack in a some nested basic block its range
can be calculated to be up to the next occurrence of the variable's
DBG_VALUE, or up to the end of the function, thus covering a basic
blocks that should not be included in the variable’s location range.
This happens because the DbgEntityHistoryCalculator ends register
locations at the end of a basic block only if the variable’s location
register has been changed throughout the function, which is not the
case for the register used to reference stack objects.
This patch also tries to produce a single value location if the location
list builder managed to merge all the locations into one.
Reviewers: aprantl, dstenb, jmorse
Reviewed By: aprantl, dstenb, jmorse
Subscribers: djtodoro, ivanbaev, asowda
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D61600
llvm-svn: 362923
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index d9e6808..b89162c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -531,6 +531,10 @@ void DwarfUnit::addConstantValue(DIE &Die, const MachineOperand &MO, addConstantValue(Die, isUnsignedDIType(DD, Ty), MO.getImm()); } +void DwarfUnit::addConstantValue(DIE &Die, uint64_t Val, const DIType *Ty) { + addConstantValue(Die, isUnsignedDIType(DD, Ty), Val); +} + void DwarfUnit::addConstantValue(DIE &Die, bool Unsigned, uint64_t Val) { // FIXME: This is a bit conservative/simple - it emits negative values always // sign extended to 64 bits rather than minimizing the number of bytes. |