From aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Thu, 13 Aug 2026 06:52:15 +0800 Subject: [Support] Split APInt and APFloat ownership --- backend/include/rcc/CodeGen/GenericConstant.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'backend/include/rcc/CodeGen/GenericConstant.h') diff --git a/backend/include/rcc/CodeGen/GenericConstant.h b/backend/include/rcc/CodeGen/GenericConstant.h index 92a8f13..4219c24 100644 --- a/backend/include/rcc/CodeGen/GenericConstant.h +++ b/backend/include/rcc/CodeGen/GenericConstant.h @@ -3,8 +3,9 @@ #ifndef RCC_CODEGEN_GENERICCONSTANT_H #define RCC_CODEGEN_GENERICCONSTANT_H +#include "rcc/ADT/APFloat.h" +#include "rcc/ADT/APInt.h" #include "rcc/CodeGen/LowLevelType.h" -#include "rcc/CodeGen/MachineOperand.h" #include "rcc/Support/Error.h" #include @@ -144,8 +145,8 @@ private: struct GenericConstantData final { GenericConstantType Type; GenericConstantKind Kind = GenericConstantKind::Invalid; - std::optional IntegerValue; - std::optional FloatingValue; + std::optional IntegerValue; + std::optional FloatingValue; std::vector ByteValue; std::vector Elements; std::string Symbol; @@ -155,11 +156,11 @@ struct GenericConstantData final { GenericConstantExpressionOpcode ExpressionOpcode = GenericConstantExpressionOpcode::Invalid; GenericConstantExpressionFlags ExpressionFlags; std::optional SourceElementType; - std::optional InRangeStart; - std::optional InRangeEnd; + std::optional InRangeStart; + std::optional InRangeEnd; - [[nodiscard]] static Expected integer(IntegerImmediate Value); - [[nodiscard]] static Expected floating(FloatingPointBits Value); + [[nodiscard]] static Expected integer(APInt Value); + [[nodiscard]] static Expected floating(APFloat Value); [[nodiscard]] static Expected byteString(GenericConstantType Type, std::vector Bytes); -- cgit v1.2.3