[all-commits] [llvm/llvm-project] 9c9f47: Make ops with StructAttr's actually verify `isa<Th...

Sean Silva via All-commits all-commits at lists.llvm.org
Tue Apr 28 14:00:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c9f479a7dc10e16fd8032875a477827db4b3b77
      https://github.com/llvm/llvm-project/commit/9c9f479a7dc10e16fd8032875a477827db4b3b77
  Author: Sean Silva <silvasean at google.com>
  Date:   2020-04-28 (Tue, 28 Apr 2020)

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    M mlir/test/IR/attribute.mlir
    M mlir/test/lib/Dialect/Test/CMakeLists.txt
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.h
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  Make ops with StructAttr's actually verify `isa<TheStruct>`.

Previously, they would only only verify `isa<DictionaryAttr>` on such attrs
which resulted in crashes down the line from code assuming that the
verifier was doing the more thorough check introduced in this patch.
The key change here is for StructAttr to use
`CPred<"$_self.isa<" # name # ">()">` instead of `isa<DictionaryAttr>`.

To test this, introduce struct attrs to the test dialect. Previously,
StructAttr was only being tested by unittests/, which didn't verify how
StructAttr interacted with ODS.

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




More information about the All-commits mailing list