This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add macro for enabling all generated pass declarations
ClosedPublic

Authored by rkayaith on Sep 27 2022, 2:47 PM.

Details

Summary

Currently the generated pass declarations have to be enabled per-pass
using multiple GEN_PASS_DECL_{PASSNAME} defines. This adds
GEN_PASS_DECL, which enables the declarations for all passes in the
group with a single macro. This is convenient for cases where a single
header is used for all passes in the group.

Diff Detail

Event Timeline

rkayaith created this revision.Sep 27 2022, 2:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2022, 2:47 PM
rkayaith published this revision for review.Sep 27 2022, 3:03 PM
mehdi_amini accepted this revision.Sep 27 2022, 9:56 PM
This revision is now accepted and ready to land.Sep 27 2022, 9:56 PM
mscuttari accepted this revision.Sep 28 2022, 12:27 AM

LGTM. What about doing this also for the definitions?

LGTM. What about doing this also for the definitions?

Might be worth adding for consistency, but I don't have a use case for that at the moment. Typically I see the pass definitions for a group being spread across multiple files.

Might be worth adding for consistency, but I don't have a use case for that at the moment. Typically I see the pass definitions for a group being spread across multiple files.

Right. We can add it later if the need will never arise.