Skip to content
Commit 8b75cc57 authored by Lei Zhang's avatar Lei Zhang Committed by jpienaar
Browse files

Define NumericAttr as the base class for BoolAttr, IntegerAttr, FloatAttr, and ElementsAttr

These attribute kinds are different from the rest in the sense that their types are defined
in MLIR's type hierarchy and we can build constant op out of them.

By defining this middle-level base class, we have a unified way to test and query the type
of these attributes, which will be useful when constructing constant ops of various dialects.

This CL also added asserts to reject non-NumericAttr in constant op's build() method.

PiperOrigin-RevId: 232188178
parent 126ec14e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment