This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Specify namespace for standard dialect using cppNamespace field
ClosedPublic

Authored by andidr on May 27 2021, 3:07 AM.

Details

Summary

The ::mlir namespace for operations from standard is currently
defined by enclosing the header file generated from the ODS in
Ops.td in a namespace in Ops.h. However, when referencing
operations from Ops.td in other TableGen files, this causes the
generated C++ code to refer to classes from the global namespace
instead of ::mlir.

By defining the namespace through the cppNamespace field for
StandardOps_Dialect directly in Ops.td instead, the ODS
becomes reusable in other TableGen files through simple
inclusion.

Diff Detail

Event Timeline

andidr created this revision.May 27 2021, 3:07 AM
andidr requested review of this revision.May 27 2021, 3:07 AM
mehdi_amini accepted this revision.May 27 2021, 9:08 AM
This revision is now accepted and ready to land.May 27 2021, 9:08 AM

Not sure why some of the unit tests fail. To me this looks unrelated to the patch. Is there any way to trigger re-running the tests?

andidr updated this revision to Diff 348775.May 31 2021, 4:32 AM

Rebased diff to HEAD to trigger re-execution of tests.

Not sure why some of the unit tests fail. To me this looks unrelated to the patch. Is there any way to trigger re-running the tests?

It's not uncommon, feel free to ignore when the tests are clearly unrelated.

This revision was landed with ongoing or failed builds.May 31 2021, 10:13 AM
This revision was automatically updated to reflect the committed changes.