[mlir] Add LLDB visualizers for MLIR constructs
authorRiver Riddle <riddleriver@gmail.com>
Thu, 8 Dec 2022 04:09:28 +0000 (20:09 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Mon, 12 Dec 2022 06:45:34 +0000 (22:45 -0800)
commit62fec084d67af5b3d55b09271a5b9aab604698f5
tree694ea073392b06c1bf6ef4fec5eed310054635d8
parent18546ff8dd45a81e72c0a2ed0561b5aec8c15ca3
[mlir] Add LLDB visualizers for MLIR constructs

This commit adds a significant amount of visualizers attempting
to cover the majority of our visualization needs. It covers:

* Operations/OperationName/Ops/OpInterfaces
* Attributes/Types/Attr|TypeInterfaces/NamedAttribute
* Blocks/Regions
* Various range types (e.g. ValueRange/TypeRange)
* Values/BlockArguments/OpResults

This does require an NFC change to interfaces to rename
the concept field to avoid clash with the base class. It
also requires exposing a few method to the debugger
to help resolve information that is non-trivial to reconstruct.
These methods are re-exported using a debug_Blah naming
scheme to avoid messing with hot methods.

Note that this makes use of the new callback feature in lldb-16
(currently trunk) that allows for providing visualizers based on
a dynamic callback, instead of just the typename. It requires
a very new lldb, but allows for providing good default visualization
for all attributes/operations/types out of the box.

Differential Revision: https://reviews.llvm.org/D139602
mlir/include/mlir/IR/Operation.h
mlir/include/mlir/IR/Value.h
mlir/include/mlir/Support/InterfaceSupport.h
mlir/utils/lldb-scripts/mlirDataFormatters.py [new file with mode: 0644]