[IntegerAttr] Add helpers for working with LLVM's APSInt type.
The FIRRTL dialect in CIRCT uses inherently signful types, and APSInt is the best way to model that. Add a couple of helpers that make it easier to work with an IntegerAttr that carries a sign. This follows the example of getZExt() and getSExt() which assert when the underlying type of the attribute is unexpected. In this case we assert fail when the underlying type of the attribute is signless. This is strictly additive, so it is NFC. It is tested in the CIRCT repo. Differential Revision: https://reviews.llvm.org/D102701
Loading
Please register or sign in to comment