Page MenuHomePhabricator

[mlir] Support OptionalAttr inside a StructAttr
ClosedPublic

Authored by tberghammer on Feb 18 2020, 7:01 AM.

Details

Summary

Previously many of the generated methods were crashing when the user
tried to pass a nullptr (translating to a null attribute) into optional
fields.

Diff Detail

Event Timeline

tberghammer created this revision.Feb 18 2020, 7:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2020, 7:01 AM

Fix attribute accessor to not crash for null values

antiagainst accepted this revision.Feb 18 2020, 3:29 PM

Nice, thanks!

This revision is now accepted and ready to land.Feb 18 2020, 3:29 PM
rriddle added inline comments.Feb 18 2020, 3:35 PM
mlir/tools/mlir-tblgen/StructsGen.cpp
147

nit: remove trivial braces here and below.

tberghammer marked an inline comment as done.

Address review comments

Re-try addressing review comments

This revision was automatically updated to reflect the committed changes.