This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add LocationAttr to the Python API
ClosedPublic

Authored by youngar on Jan 24 2023, 11:45 PM.

Details

Summary

This is a follow up to D142182, to expose LocationAttrs through Python.

Diff Detail

Event Timeline

youngar created this revision.Jan 24 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald Transcript
youngar requested review of this revision.Jan 24 2023, 11:45 PM
ftynse added inline comments.Jan 25 2023, 1:24 AM
mlir/lib/Bindings/Python/IRCore.cpp
2561–2566

Any reason why this is not a property?

youngar updated this revision to Diff 492149.Jan 25 2023, 9:15 AM
  • Change get_attr to a property attr
  • Use the actual c-api functions, s/Attr/Attribute
youngar added inline comments.Jan 25 2023, 9:17 AM
mlir/lib/Bindings/Python/IRCore.cpp
2561–2566

Updated this to be a property named "attr". I was not sure if I should name it "attribute" or "attr", but the closest I see that NamedAttribute has "attr".

ftynse accepted this revision.Jan 25 2023, 9:21 AM
This revision is now accepted and ready to land.Jan 25 2023, 9:21 AM
This revision was automatically updated to reflect the committed changes.