This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Python] Add casting constructor to Type and Attribute.
ClosedPublic

Authored by stellaraccident on May 2 2021, 3:17 PM.

Details

Summary
  • This makes them consistent with custom types/attributes, whose constructors will do a type checked conversion. Of course, the base classes can represent everything so never error.
  • More importantly, this makes it possible to subclass Type and Attribute out of tree in sensible ways.

Diff Detail

Event Timeline

stellaraccident created this revision.May 2 2021, 3:17 PM
stellaraccident requested review of this revision.May 2 2021, 3:17 PM
jdd accepted this revision.May 3 2021, 12:28 AM

LGTM! Thanks

This revision is now accepted and ready to land.May 3 2021, 12:28 AM
ftynse accepted this revision.May 3 2021, 12:31 AM
mikeurbach accepted this revision.May 3 2021, 6:18 AM
This revision was landed with ongoing or failed builds.May 3 2021, 10:12 AM
This revision was automatically updated to reflect the committed changes.