[mlir] Allow passing AsmState when printing Attributes and Types
authorRiver Riddle <riddleriver@gmail.com>
Sat, 3 Sep 2022 04:23:47 +0000 (21:23 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 6 Sep 2022 21:45:12 +0000 (14:45 -0700)
commitf3502afe852693a19848e9e328f2c2a55fc9e9bb
treefcaaf6157fe49399a438268747ba84e1ecd61d2d
parent839b436c93604e042f74050cf2adadd75f30e898
[mlir] Allow passing AsmState when printing Attributes and Types

This allows for extracting assembly information when printing an attribute
or type, such as the dialect resources referenced. This functionality is used in
a followup that adds resource support to the bytecode. This change also results
in a nice cleanup of AsmPrinter now that we don't need to awkwardly workaround
optional AsmStates.

Differential Revision: https://reviews.llvm.org/D132728
mlir/include/mlir/IR/AsmState.h
mlir/include/mlir/IR/Attributes.h
mlir/include/mlir/IR/Types.h
mlir/lib/IR/AsmPrinter.cpp