[all-commits] [llvm/llvm-project] 6609c1: [mlir] Add a better error message when failing to ...

River Riddle via All-commits all-commits at lists.llvm.org
Thu May 5 15:07:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6609c1cc5997baa75c45283fd559897334e5d1a2
      https://github.com/llvm/llvm-project/commit/6609c1cc5997baa75c45283fd559897334e5d1a2
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-05-05 (Thu, 05 May 2022)

  Changed paths:
    M flang/test/Fir/invalid-types.fir
    M mlir/lib/Parser/AttributeParser.cpp
    M mlir/test/Dialect/SPIRV/IR/composite-ops.mlir
    M mlir/test/Dialect/SPIRV/IR/memory-ops.mlir
    M mlir/test/IR/invalid-locations.mlir
    M mlir/test/IR/invalid.mlir
    M mlir/test/mlir-tblgen/attr-or-type-format.mlir

  Log Message:
  -----------
  [mlir] Add a better error message when failing to parse an attribute

The fallback attribute parse path is parsing a Type attribute, but this results
in a really unintuitive error message: `expected non-function type`, which
doesn't really hint at tall that we were trying to parse an attribute. This
commit fixes this by trying to optionally parse a type, and on failure
emitting an error that we were expecting an attribute.

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




More information about the All-commits mailing list