[Lldb-commits] [PATCH] D142552: [lldb] Make GetDIENamesAndRanges() allow 0-valued decl and call lines

David Stenberg via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 25 08:18:28 PST 2023


dstenb created this revision.
dstenb added reviewers: jasonmolenda, clayborg, aeubanks, ayermolo.
dstenb added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a reviewer: shafik.
Herald added a project: All.
dstenb requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: lldb-commits, sstefan1.

In an upcoming patch Clang is proposed to be changed to emit
line locations that are inlined at line 0. This clashed with the behavior of
GetDIENamesAndRanges() which used 0 as a default value to determine if
file, line or column numbers had been set. Users of that function then
checked for any non-0 values when setting up the call site:

  if (call_file != 0 || call_line != 0 || call_column != 0)
    [...]

which did not work with the Clang change since all three values then
could be 0.

This changes the function to use std::optional to catch non-set values
instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142552

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/test/Shell/SymbolFile/DWARF/Inputs/inlined-file0-line0-col0.yaml
  lldb/test/Shell/SymbolFile/DWARF/inlined-file0-line0-col0.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142552.492121.patch
Type: text/x-patch
Size: 34591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230125/3edf079e/attachment-0001.bin>


More information about the lldb-commits mailing list