This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by Mogball on Oct 14 2021, 5:03 PM.
Tokens
"Like" token, awarded by matthiaskramm.

Details

Summary

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.
mlir/tools/mlir-tblgen/RewriterGen.cpp
53–58

Why the cpp prefix?

199

Twine should be passed by const &

323

Same here.

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

Drive by :)

mlir/tools/mlir-tblgen/RewriterGen.cpp
199

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.