This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add isa<> support for Dialects.
ClosedPublic

Authored by tpopp on Apr 29 2020, 6:56 AM.

Details

Summary

The purpose of this is to aid in having code behave differently on
Operations based on their Dialect without caring about the specific
Op. Additionally this is consistent with most other types supporting
isa<> and dyn_cast<>.

A Dialect matches isa<> based only on its namespace and relies on each
namespace being unique.

Diff Detail

Event Timeline

tpopp created this revision.Apr 29 2020, 6:56 AM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle accepted this revision.Apr 29 2020, 10:05 AM
rriddle added inline comments.
mlir/include/mlir/IR/Dialect.h
292

nit: Drop this newline.

This revision is now accepted and ready to land.Apr 29 2020, 10:05 AM
tpopp updated this revision to Diff 261154.Apr 30 2020, 2:11 AM

Remove newline.

This revision was automatically updated to reflect the committed changes.