This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpFormatGen] Update "custom" directives for attributes.
ClosedPublic

Authored by mikeurbach on Sep 17 2020, 2:57 PM.

Details

Summary

This tweaks the generated code for parsing attributes with a custom
directive to call addAttribute on the OperationState directly,
and adds a newline after this call. Previously, the generated code
would call addAttribute on the OperationState field attributes,
which has no such method and fails to compile. Furthermore, the lack
of newline would generate code with incorrectly formatted single line
if statements. Added tests for parsing and printing attributes with
a custom directive.

Diff Detail

Event Timeline

mikeurbach created this revision.Sep 17 2020, 2:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2020, 2:57 PM
mikeurbach requested review of this revision.Sep 17 2020, 2:57 PM
mehdi_amini accepted this revision.Sep 22 2020, 10:48 PM

LGTM

It wasn't clear from the description that this is actually fixing something that wasn't working, can you update the description in the commit?

This revision is now accepted and ready to land.Sep 22 2020, 10:48 PM

Update description about custom directive attribute parsing

This adds some description about the issue and why this revision was needed.

mikeurbach added a comment.EditedSep 23 2020, 10:00 AM

@mehdi_amini I've amended the commit description to include some background on the issue this revision intends to fix.

mikeurbach edited the summary of this revision. (Show Details)

Use arc diff --edit --verbatim to update summary

This is my first contribution to LLVM, so I will need need some assistance per the policy. @mehdi_amini as the reviewer, do you mind committing this on my behalf? Not sure if this is already associated in Phabricator, but my name is Mike Urbach, and email is mikeurbach@gmail.com. The GitHub username is also mikeurbach, if that is needed.

This revision was landed with ongoing or failed builds.Sep 23 2020, 11:33 AM
This revision was automatically updated to reflect the committed changes.