[all-commits] [llvm/llvm-project] d29d1e: Add python bindings for Type and IntegerType.

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Wed Aug 19 09:24:27 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d29d1e2ffd61f450b4392d2dab8060e54d040fcf
      https://github.com/llvm/llvm-project/commit/d29d1e2ffd61f450b4392d2dab8060e54d040fcf
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2020-08-19 (Wed, 19 Aug 2020)

  Changed paths:
    M mlir/include/mlir-c/IR.h
    M mlir/lib/Bindings/Python/IRModules.cpp
    M mlir/lib/Bindings/Python/IRModules.h
    A mlir/test/Bindings/Python/ir_module.py
    R mlir/test/Bindings/Python/ir_module_test.py
    A mlir/test/Bindings/Python/ir_types.py

  Log Message:
  -----------
  Add python bindings for Type and IntegerType.

* The binding for Type is trivial and should be non-controversial.
* The way that I define the IntegerType should serve as a pattern for what I want to do next.
* I propose defining the rest of the standard types in this fashion and then generalizing for dialect types as necessary.
* Essentially, creating/accessing a concrete Type (vs interacting with the string form) is done by "casting" to the concrete type (i.e. IntegerType can be constructed with a Type and will throw if the cast is illegal).
* This deviates from some of our previous discussions about global objects but I think produces a usable API and we should go this way.

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




More information about the All-commits mailing list