This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Allow `Attribute::print` to elide the type
ClosedPublic

Authored by Mogball on Sep 13 2022, 5:36 PM.

Details

Summary

This patch adds a flag to Attribute::print that prints the attribute
without its type.

Fixes #57689

Diff Detail

Event Timeline

Mogball created this revision.Sep 13 2022, 5:36 PM
Mogball requested review of this revision.Sep 13 2022, 5:36 PM
lattner accepted this revision.Sep 14 2022, 12:47 PM

nice, thank you Jeff!

This revision is now accepted and ready to land.Sep 14 2022, 12:47 PM
rriddle accepted this revision.Sep 14 2022, 1:17 PM
rriddle added inline comments.
mlir/include/mlir/IR/Attributes.h
80

I'd use a default for this as well.

Mogball updated this revision to Diff 460280.Sep 14 2022, 6:17 PM

add default

This revision was landed with ongoing or failed builds.Sep 14 2022, 6:17 PM
This revision was automatically updated to reflect the committed changes.

Can yo

mlir/include/mlir/IR/Attributes.h
80

This should be documented IMO: it's not clear to me what it does or what the implications are: please include hints about when to use this in the doc (can I parse the attribute back? )

It does not help that not having test makes this basically dead code in the codebase right now

Can yo

?

I updated the doc