[all-commits] [llvm/llvm-project] ab9cdf: [mlir:Parser] Don't use strings for the "ugly" for...

River Riddle via All-commits all-commits at lists.llvm.org
Tue Jul 5 16:21:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab9cdf09f4f03259e7e75c5187139e6628a37815
      https://github.com/llvm/llvm-project/commit/ab9cdf09f4f03259e7e75c5187139e6628a37815
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-07-05 (Tue, 05 Jul 2022)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIRType.cpp
    M mlir/docs/LangRef.md
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/Parser/DialectSymbolParser.cpp
    M mlir/lib/Parser/Parser.h
    M mlir/lib/Parser/ParserState.h
    M mlir/test/Dialect/EmitC/types.mlir
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/OpenACC/ops.mlir
    M mlir/test/Dialect/OpenMP/ops.mlir
    M mlir/test/Dialect/Quant/parse-any-invalid.mlir
    M mlir/test/Dialect/Quant/parse-calibrated-invalid.mlir
    M mlir/test/Dialect/Quant/parse-uniform-invalid.mlir
    M mlir/test/IR/enum-attr-invalid.mlir
    M mlir/test/IR/enum-attr-roundtrip.mlir
    M mlir/test/IR/invalid.mlir
    M mlir/test/IR/parser.mlir
    M mlir/test/Target/Cpp/types.mlir
    M mlir/test/mlir-tblgen/attr-or-type-format-roundtrip.mlir
    M mlir/test/mlir-tblgen/attr-or-type-format.mlir
    M mlir/test/mlir-tblgen/testdialect-attrdefs.mlir
    M mlir/test/python/ir/attributes.py

  Log Message:
  -----------
  [mlir:Parser] Don't use strings for the "ugly" form of Attribute/Type syntax

This commit refactors the syntax of "ugly" attribute/type formats to not use
strings for wrapping. This means that moving forward attirbutes and type formats
will always need to be in some recognizable form, i.e. if they use incompatible
characters they will need to manually wrap those in a string, the framework will
no longer do it automatically.

This has the benefit of greatly simplifying how parsing attributes/types work, given
that we currently rely on some extremely complicated nested parser logic which is
quite problematic for a myriad of reasons; unecessary complexity(we create a nested
source manager/lexer/etc.), diagnostic locations can be off/wrong given string escaping,
etc.

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




More information about the All-commits mailing list