[all-commits] [llvm/llvm-project] 7bfdac: [MLIR] Expose LocationAttrs in the C API

Andrew Young via All-commits all-commits at lists.llvm.org
Tue Jan 24 23:18:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7bfdac0e6dd8d9d9a2f8546dedea5d7ffcb5317e
      https://github.com/llvm/llvm-project/commit/7bfdac0e6dd8d9d9a2f8546dedea5d7ffcb5317e
  Author: Andrew Young <youngar17 at gmail.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M mlir/include/mlir-c/BuiltinAttributes.h
    M mlir/include/mlir-c/IR.h
    M mlir/lib/CAPI/IR/BuiltinAttributes.cpp
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/test/CAPI/ir.c

  Log Message:
  -----------
  [MLIR] Expose LocationAttrs in the C API

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.

Reviewed By: mikeurbach, Mogball

Differential Revision: https://reviews.llvm.org/D142182




More information about the All-commits mailing list