This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Expose LocationAttrs in the C API
ClosedPublic

Authored by youngar on Jan 19 2023, 11:03 PM.

Details

Summary

This patch adds three functions to the C API:

  • mlirAttributeIsALocation: returns true if the attribute is a LocationAttr, false otherwise.
  • mlirLocationGetAttribute: returns the underlying LocationAttr of a Location.
  • mlirLocationFromAttribute: gets a Location from a LocationAttr.

Diff Detail

Event Timeline

youngar created this revision.Jan 19 2023, 11:03 PM
youngar requested review of this revision.Jan 19 2023, 11:03 PM
mikeurbach accepted this revision.Jan 23 2023, 12:57 PM
mikeurbach added subscribers: Mogball, ftynse, mikeurbach.

I think this looks good to me. Not sure why the pre-merge tests failed...

Also don't know who should be added as a reviewer. Looking at the git history, maybe @mehdi_amini, @ftynse, @rriddle, or @Mogball could take a look?

This revision is now accepted and ready to land.Jan 23 2023, 12:57 PM
youngar updated this revision to Diff 491599.EditedJan 23 2023, 9:33 PM
youngar edited the summary of this revision. (Show Details)

Apparently you should not upload patches created --no-prefix to phabricator. This fixes the issues, namely unintended file moving, which resulted from that.

Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 9:33 PM
Mogball accepted this revision.Jan 24 2023, 10:51 PM
This revision was automatically updated to reflect the committed changes.