[all-commits] [llvm/llvm-project] 596da6: Add support for custom op parser/printer hooks to ...

Chris Lattner via All-commits all-commits at lists.llvm.org
Mon Mar 23 08:58:11 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 596da62d21ede197dd95eca5146d2ddf0497275c
      https://github.com/llvm/llvm-project/commit/596da62d21ede197dd95eca5146d2ddf0497275c
  Author: Chris Lattner <chrisl at clattner-0291.local>
  Date:   2020-03-23 (Mon, 23 Mar 2020)

  Changed paths:
    M mlir/include/mlir/IR/OpImplementation.h
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/test/IR/parser.mlir
    M mlir/test/lib/TestDialect/TestDialect.cpp
    M mlir/test/lib/TestDialect/TestOps.td

  Log Message:
  -----------
  Add support for custom op parser/printer hooks to know about result names.

Summary:
This allows the custom parser/printer hooks to do interesting things with
the SSA names.  This patch:

 - Adds a new 'getResultName' method to OpAsmParser that allows a parser
   implementation to get information about its result names, along with
   a getNumResults() method that allows op parser impls to know how many
   results are expected.
 - Adds a OpAsmPrinter::printOperand overload that takes an explicit stream.
 - Adds a test.string_attr_pretty_name operation that uses these hooks to
   do fancy things with the result name.

Reviewers: rriddle!

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list