[all-commits] [llvm/llvm-project] 2b09a8: [OpAsmParser] Refactor parseOptionalInteger to sup...

Chris Lattner via All-commits all-commits at lists.llvm.org
Mon May 10 22:47:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b09a89daf956795d82076d983c3d78b96e1af4b
      https://github.com/llvm/llvm-project/commit/2b09a89daf956795d82076d983c3d78b96e1af4b
  Author: Chris Lattner <clattner at nondot.org>
  Date:   2021-05-10 (Mon, 10 May 2021)

  Changed paths:
    M mlir/include/mlir/IR/DialectImplementation.h
    M mlir/include/mlir/IR/OpImplementation.h
    M mlir/lib/Parser/DialectSymbolParser.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Parser/Parser.h

  Log Message:
  -----------
  [OpAsmParser] Refactor parseOptionalInteger to support wide integers, NFC.

OpAsmParser (and DialectAsmParser) supports a pair of
parseInteger/parseOptionalInteger methods, which allow parsing a bare
integer into a C type of your choice (e.g. int8_t) using templates.  It
was implemented in terms of a virtual method call that is hard coded to
int64_t because "that should be big enough".

Change the virtual method hook to return an APInt instead.  This allows
asmparsers for custom ops to parse large integers if they want to, without
changing any of the clients of the fixed size C API.

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




More information about the All-commits mailing list