mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
This PR adds better support for differentiating complex and imaginary floating-point types from real floating-point types, in both the AST and in the IR type system. *AST Changes* - Introduces the new class `TypeDomain`, which can be either `RealDomain`, `ImaginaryDomain` or `ComplexDomain`. "type domain" is the term used for this concept in the C standard, and I couldn't think of a better one. - Introduces `FloatingPointType.getDomain()`, to get the type domain of the type. - Introduces `FloatingPointType.getBase()`, to get the numeric base of the type (either 2 or 10). - Introduces three new subtypes of `FloatingPointType`: `RealNumberType`, `ComplexNumberType`, and `ImaginaryNumberType`, which differentiate between the types based on their type domain. Note that the decimal types (e.g., `_Decimal32`) are included in `RealNumberType`. - Introduces two new subtypes of `FloatingPointType`: `BinaryFloatingPointType` and `DecimalFloatingPointType`, which differentiate between the types based on their numeric base, independent of type domain. *IR Changes* - `IRFloatingPointType` now has two additional parameters: the base and the type domain. - New test that ensures that C++ types get mapped to the correct IR types. - New IR test that verifies the IR for some basic usage of complex FP types.