[Mlir-commits] [mlir] [mlir] Support better printing for mutually recursive types (PR #112160)
River Riddle
llvmlistbot at llvm.org
Mon Oct 14 12:49:45 PDT 2024
================
@@ -525,7 +529,7 @@ void TestRecursiveAliasType::print(AsmPrinter &printer) const {
printer.tryStartCyclicPrint(*this);
----------------
River707 wrote:
> used to signal that you must print a forward declaration, whereas this new check signals that you may print a forward declaration
I think I'm missing the distinction here. I don't see why we care to differentiate these two, why would you not print the elided form if you could? My expectation for the parser/printer API for recursive things would be: If the printer tells you that it's okay to elide, you do. In the parser you just check whether you're parsing the elided or non-elided form. As an aside, for this stuff I'd err on changing the contract of the current cyclic printing/parsing logic, it has ~4 uses in tree (2 of which are in tests), I'd hope we can just continue to evolve the recursive support (and not add more constructs).
https://github.com/llvm/llvm-project/pull/112160
More information about the Mlir-commits
mailing list