[all-commits] [llvm/llvm-project] 49af2a: [mlir][flang] Do not prevent integer types from be...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Sep 2 23:43:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 49af2a62758a9a526ce446111acaa2cbd5fd2a6e
      https://github.com/llvm/llvm-project/commit/49af2a62758a9a526ce446111acaa2cbd5fd2a6e
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2021-09-03 (Fri, 03 Sep 2021)

  Changed paths:
    M flang/test/Fir/fir-types.fir
    M mlir/lib/Dialect/Quant/IR/TypeParser.cpp
    M mlir/lib/Parser/DialectSymbolParser.cpp
    M mlir/test/mlir-tblgen/types.mlir

  Log Message:
  -----------
  [mlir][flang] Do not prevent integer types from being parsed as MLIR keywords

DialectAsmParser::parseKeyword is rejecting `'i' digit+` while it is
a valid identifier according to mlir/docs/LangRef.md.

Integer types actually used to be TOK_KEYWORD a while back before the
change: https://github.com/llvm/llvm-project/commit/6af866c58d21813fb243906611d02bb2a8ffa43a.

This patch Modifies `isCurrentTokenAKeyword` to return true for tokens that
match integer types too.

The motivation for this change is the parsing of `!fir.type<{` `component-name: component-type,`+ `}>`
type in FIR that represent Fortran derived types. The component-names are
parsed as keywords, and can very well be i32 or any ixxx (which are
valid Fortran derived type component names).

The Quant dialect type parser had to be modified since it relied on `iw` not
being parsed as keywords.

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




More information about the All-commits mailing list