[PATCH] D142182: [MLIR] Expose LocationAttrs in the C API

Andrew Young via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 23:04:00 PST 2023


youngar created this revision.
Herald added subscribers: Moerafaat, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, jdoerfert, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini.
Herald added a project: All.
youngar requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, nicolasvasilache.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142182

Files:
  include/mlir-c/BuiltinAttributes.h
  include/mlir-c/IR.h
  lib/CAPI/IR/BuiltinAttributes.cpp
  lib/CAPI/IR/IR.cpp
  test/CAPI/ir.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142182.490728.patch
Type: text/x-patch
Size: 4277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230120/6ba24482/attachment.bin>


More information about the llvm-commits mailing list