This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Generate Dialect constructors in .cpp instead of .h
ClosedPublic

Authored by rriddle on Apr 22 2022, 2:17 PM.

Details

Summary

By generating in the .h file, we were forcing dialects to include
a lot of additional header files because:

  • Fields of the dialect, e.g. std::unique_ptr<>, were unable to use forward declarations.
  • Dependent dialects are loaded in the constructor, requiring the full definition of each dependent dialect (which, depending on the file structure of the dialect, may include the operations).

By generating in the .cpp we get much faster builds, and also
better align with the rest of the code base.

Fixes #55044

Diff Detail

Event Timeline

rriddle created this revision.Apr 22 2022, 2:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 2:17 PM
rriddle requested review of this revision.Apr 22 2022, 2:17 PM
rriddle updated this revision to Diff 424609.Apr 22 2022, 2:24 PM
lattner accepted this revision.Apr 22 2022, 3:02 PM

Fantastic, thank you!

This revision is now accepted and ready to land.Apr 22 2022, 3:02 PM