[all-commits] [llvm/llvm-project] 70d8fe: [mlir] Refactor the structure of the 'verifyConstr...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Feb 20 10:38:28 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 70d8fec7c947996e857aa136aa22c22a555b02fa
      https://github.com/llvm/llvm-project/commit/70d8fec7c947996e857aa136aa22c22a555b02fa
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-02-20 (Thu, 20 Feb 2020)

  Changed paths:
    M mlir/docs/DefiningAttributesAndTypes.md
    M mlir/include/mlir/Dialect/QuantOps/QuantTypes.h
    M mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
    M mlir/include/mlir/IR/Attributes.h
    M mlir/include/mlir/IR/Location.h
    M mlir/include/mlir/IR/StandardTypes.h
    M mlir/include/mlir/IR/StorageUniquerSupport.h
    M mlir/include/mlir/IR/Types.h
    M mlir/lib/Dialect/QuantOps/IR/QuantTypes.cpp
    M mlir/lib/Dialect/SPIRV/TargetAndABI.cpp
    M mlir/lib/IR/Attributes.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/StandardTypes.cpp
    M mlir/lib/IR/Types.cpp

  Log Message:
  -----------
  [mlir] Refactor the structure of the 'verifyConstructionInvariants' methods.

Summary:
The current structure suffers from several problems, but the main one is that a construction failure is impossible to debug when using the 'get' methods. This is because we only optionally emit errors, so there is no context given to the user about the problem. This revision restructures this so that errors are always emitted, and the 'get' methods simply pass in an UnknownLoc to emit to. This allows for removing usages of the more constrained "emitOptionalLoc", as well as removing the need for the context parameter.

Fixes [PR#44964](https://bugs.llvm.org/show_bug.cgi?id=44964)

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




More information about the All-commits mailing list