This is an archive of the discontinued LLVM Phabricator instance.

[mlir:LLVM][NFC] Cleanup attribute/enum definitions
ClosedPublic

Authored by rriddle on Oct 20 2022, 5:58 PM.

Details

Summary

Enum definitions are currently spread throughout the op definitions
file, making it difficult to reason about both where they are, and
where to add new ones when necessary. The attribute definitions are
in a similarish case, where while they have a dedicated .td file, there
definitions/declarations are generated in the main LLVMDialect source
files. This makes it difficult to reason about how to cleanly add new
attributes/enums.

This commit adds a dedicated LLVMEnums.td file for enum definitions,
cleans up the AttrDefs.td file, and adds a new LLVMAttrs.cpp/.h file to
home enum/attr definitions moving forward. This makes it much cleaner to
add new attributes/enums to the LLVM dialect.

Depends on D136408

Diff Detail

Event Timeline

rriddle created this revision.Oct 20 2022, 5:58 PM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Oct 20 2022, 5:58 PM
This revision is now accepted and ready to land.Oct 21 2022, 12:53 PM
This revision was automatically updated to reflect the committed changes.