[all-commits] [llvm/llvm-project] e5a8c8: [mlir] Refactoring a few Parser APIs

Sandeep Dasgupta via All-commits all-commits at lists.llvm.org
Mon Nov 22 22:13:12 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e5a8c8c883f1f3f91f40c883dd4f613aca0f7105
      https://github.com/llvm/llvm-project/commit/e5a8c8c883f1f3f91f40c883dd4f613aca0f7105
  Author: Sandeep Dasgupta <sdasgup at google.com>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M mlir/include/mlir/IR/OpImplementation.h
    M mlir/lib/Parser/Parser.cpp
    A mlir/test/IR/pretty_printed_region_op.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  [mlir] Refactoring a few Parser APIs

Refactored two new parser APIs parseGenericOperationAfterOperands and
 parseCustomOperationName out of parseGenericOperation and parseCustomOperation.

Motivation: Sometimes an op can be printed in a special way if certain criteria
is met. While parsing, we need to handle all the versions.
`parseGenericOperationAfterOperands` is handy in situation where we already
parsed the operands and decide to fall back to default parsing.

`parseCustomOperationName` is useful when we need to know details (dialect,
operation name etc.) about a parsed token meant to be an mlir operation.

Reviewed By: rriddle

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




More information about the All-commits mailing list