Add IntegerAttr::verifyConstructionInvariants.
authorSean Silva <silvasean@google.com>
Wed, 29 Jan 2020 00:58:34 +0000 (16:58 -0800)
committerSean Silva <silvasean@google.com>
Wed, 29 Jan 2020 20:22:51 +0000 (12:22 -0800)
commit9accbd58fb3f1dc824a7e43aef5c14b60b7dcefb
treebe4008658e906fb4f1d99b655da5efeb40ac3339
parentc64b56617da293685d6467bd38ad000f8c4fd75e
Add IntegerAttr::verifyConstructionInvariants.

Summary:
This will help catch improper use of the MLIR API's. In particular, this
catches an error that was manifesting as nondeterministic assertion
failures (the nondeterminism was due to the failure happening only when the
StorageUniquer's DenseMap's probing happened to compare two specific
keys).

No test. The fact that all the existing tests pass with this additional
invariant gives confidence that it is correct/useful.

Differential Revision: https://reviews.llvm.org/D73645
mlir/include/mlir/IR/Attributes.h
mlir/lib/IR/Attributes.cpp