This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Support dialect specific content emission via hooks
ClosedPublic

Authored by antiagainst on Jan 10 2020, 8:29 AM.

Details

Summary

Thus far we can only generate the same set of methods even for
operations in different dialects. This is problematic for dialects that
want to generate additional operation class methods programmatically,
e.g., a special builder method or attribute getter method. Apparently
we cannot update the OpDefinitionsGen backend every time when such
a need arises. So this CL introduces a hook into the OpDefinitionsGen
backend to allow dialects to emit additional methods and traits to
operation classes.

To make this happen, existing helper classes for C++ code emission
are exposed via a new header file. Code related to it involves NFC.

Diff Detail

Event Timeline

antiagainst created this revision.Jan 10 2020, 8:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2020, 8:29 AM

Add missing macro guard

Unit tests: pass. 61747 tests passed, 0 failed and 780 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Unit tests: pass. 61747 tests passed, 0 failed and 780 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

This majority of the code is about moving classes to includes to expose them to the outside world, the new portions are self-contained, LGTM.

This revision is now accepted and ready to land.Jan 10 2020, 11:51 AM

This majority of the code is about moving classes to includes to expose them to the outside world, the new portions are self-contained, LGTM.

Yup. Actually I splitted them into two commits: the first one purely for code moving; the second one contains the hook support. I'll land them as two separate commits for better Git history.

This revision was automatically updated to reflect the committed changes.