HomePhabricator

DWARF: Make DIERefs always valid

Description

DWARF: Make DIERefs always valid

Summary:
This patch makes the DIERef class always valid by default constructor
and operator bool. This allows one to express the validity of a DIERef
in the type system. Places which are working with potentially-invalid
DIERefs have been updated to use Optional<DIERef> instead.

The constructor taking a DWARFFormValue was not needed, as all places
which were constructing a DIERef this way were immediately converting it
into a DWARFDIE or a user_id. This can be done without constructing an
intermediate DIERef.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: arphaman, lldb-commits

Differential Revision: https://reviews.llvm.org/D63399

Details

Committed
labathWed, Jun 19, 12:32 AM
Differential Revision
D63399: DWARF: Make DIERefs always valid
Parents
rL363766: Revert "[clangd] Return vector<TextEdit> from applyTweak. NFC"
Branches
Unknown
Tags
Unknown