This is an archive of the discontinued LLVM Phabricator instance.

[mlir][python] Add 'loc' property to ops
ClosedPublic

Authored by rkayaith on Oct 17 2021, 8:51 PM.

Details

Summary

Add a read-only loc property to Operation and OpView

Diff Detail

Event Timeline

rkayaith created this revision.Oct 17 2021, 8:51 PM
rkayaith requested review of this revision.Oct 17 2021, 8:51 PM
ftynse requested changes to this revision.Oct 18 2021, 12:16 AM
ftynse added a subscriber: ftynse.

Thanks! A couple of naming nits.

mlir/include/mlir-c/IR.h
361

We tend to use full words in C API (and in Python below), so mlirOperationGetLocation.

mlir/lib/Bindings/Python/IRCore.cpp
2147

"location" please.

2149

Please expand auto. We use auto when the type is obvious from context or excessively long to spell out.

This revision now requires changes to proceed.Oct 18 2021, 12:16 AM
rkayaith updated this revision to Diff 380373.Oct 18 2021, 6:40 AM

address comments

ftynse accepted this revision.Oct 18 2021, 6:45 AM
This revision is now accepted and ready to land.Oct 18 2021, 6:45 AM

Please let me know if you need help landing this.

rkayaith marked 3 inline comments as done.Oct 18 2021, 6:58 AM

Thanks for the review, could you land this?

This revision was automatically updated to reflect the committed changes.