Page MenuHomePhabricator

[MLIR][ODS] default-valued strings should be in quotes

Authored by Mogball on Oct 14 2021, 5:03 PM.



DefaultValuedAttr<StrAttr, ""> and ConstantAttr<StrAttr, "">
result in bugs in which TableGen will not recognize that the attribute
has a default value, because "" is an empty TableGen string.

Strings no longer have special treatment. Instead, string values must be
wrapped in quotes: "\"foo\"". Two helpers, DefaultValuedStrAttr and
ConstantStrAttr have been added to keep code clean.

Diff Detail

Event Timeline

Mogball created this revision.Oct 14 2021, 5:03 PM
Mogball requested review of this revision.Oct 14 2021, 5:03 PM
rriddle accepted this revision.Oct 14 2021, 5:09 PM
rriddle added inline comments.

Why the cpp prefix?


Twine should be passed by const &


Same here.

This revision is now accepted and ready to land.Oct 14 2021, 5:09 PM

Drive by :)


Pass Twine as const Twine&

Mogball updated this revision to Diff 379891.Oct 14 2021, 5:16 PM
Mogball marked 3 inline comments as done.

Review comments

Mogball marked an inline comment as done.Oct 14 2021, 5:17 PM
This revision was automatically updated to reflect the committed changes.