This is an archive of the discontinued LLVM Phabricator instance.

Align adaptor's generator accessors for attribute on the Op class
ClosedPublic

Authored by mehdi_amini on Dec 31 2021, 3:24 PM.

Details

Summary

Each attribute has two accessor: one suffixed with Attr which returns the attribute itself
and one without the suffix which unwrap the attribute.
For example for a StringAttr attribute with a field named kind, we'll generate:

StringAttr getKindAttr();
StringRef getKind();

Diff Detail

Event Timeline

mehdi_amini created this revision.Dec 31 2021, 3:24 PM
mehdi_amini requested review of this revision.Dec 31 2021, 3:24 PM
rriddle accepted this revision.Dec 31 2021, 3:31 PM
rriddle added inline comments.
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
2595–2600

Is this copied from the non-adaptor code? I assume we can't share code here?

This revision is now accepted and ready to land.Dec 31 2021, 3:31 PM

Refactor common code

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
2595–2600

I refactored in a free function for now

This revision was landed with ongoing or failed builds.Jan 4 2022, 9:42 PM
This revision was automatically updated to reflect the committed changes.