This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Make MLIRContext::getOrLoadDialect(StringRef, TypeID, ...) public
ClosedPublic

Authored by math-fehr on Jan 20 2021, 2:15 PM.

Details

Summary

Having this function in a public scope is helpful to register dialects that are
defined at runtime, and thus that need a runtime-defined TypeID.

Also, a similar function in DialectRegistry, insert(TypeID, StringRef, ...), has
a public scope.

Diff Detail

Event Timeline

math-fehr created this revision.Jan 20 2021, 2:15 PM
math-fehr requested review of this revision.Jan 20 2021, 2:15 PM
mehdi_amini accepted this revision.Jan 20 2021, 3:04 PM
mehdi_amini added inline comments.
mlir/include/mlir/IR/MLIRContext.h
163–165

Can you document that the use of this method is discouraged in favor of getOrLoadDialect<DialectClass>() ?

This revision is now accepted and ready to land.Jan 20 2021, 3:04 PM
math-fehr updated this revision to Diff 318034.Jan 20 2021, 3:25 PM

Add comment explaining that the use of the method is discouraged for most of the cases.

math-fehr marked an inline comment as done.Jan 20 2021, 3:27 PM

Do you need me to land this for you?

Oh yes sorry I forgot to mention that! I'll remember next time.
Thanks!

This revision was landed with ongoing or failed builds.Jan 20 2021, 4:30 PM
This revision was automatically updated to reflect the committed changes.