ConstantEvaluator: respect integer type hints in arithmetic operations.

This commit is contained in:
Christian Parpart
2020-11-13 15:33:20 +01:00
parent 0ae504f883
commit 74912d65cb
6 changed files with 110 additions and 51 deletions
+5
View File
@@ -568,6 +568,11 @@ public:
u256 literalValue(Literal const* _literal) const override;
TypePointer mobileType() const override;
/// @returns the underlying raw literal value.
///
/// @see literalValue(Literal const*))
rational const& value() const noexcept { return m_value; }
/// @returns the smallest integer type that can hold the value or an empty pointer if not possible.
IntegerType const* integerType() const;
/// @returns the smallest fixed type that can hold the value or incurs the least precision loss,