[all-commits] [llvm/llvm-project] b57d6f: [mlir][Python] Add casting constructor to Type and...

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Mon May 3 10:13:01 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b57d6fe42ed3bc6867fab25be0edcb124ea0629f
      https://github.com/llvm/llvm-project/commit/b57d6fe42ed3bc6867fab25be0edcb124ea0629f
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2021-05-03 (Mon, 03 May 2021)

  Changed paths:
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/test/Bindings/Python/ir_attributes.py
    M mlir/test/Bindings/Python/ir_types.py

  Log Message:
  -----------
  [mlir][Python] Add casting constructor to Type and Attribute.

* This makes them consistent with custom types/attributes, whose constructors will do a type checked conversion. Of course, the base classes can represent everything so never error.
* More importantly, this makes it possible to subclass Type and Attribute out of tree in sensible ways.

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




More information about the All-commits mailing list