HomePhabricator

[llvm][utils] Support dereferencing llvm::Optional lldb formatter

Authored by kastiglione on Feb 21 2021, 9:45 PM.

Description

[llvm][utils] Support dereferencing llvm::Optional lldb formatter

Add deref support to llvm::Optional in lldbDataFormatters.py.

This creates a synthetic provider that adds dereference support, but otherwise proxies all access to the underlying value.

With this change, an optional value can be displayed by running v *someOptional, and its contents can be accessed with the arrow operator->, for example v someOpt->HasThing. This matches expressions usable from expression evaluation.

See also D97165 and D97524.

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