From aa69e15c6909c3b162b15f5326f0a72ba9bb7163 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Thu, 13 Aug 2026 23:55:38 +0800 Subject: [CodeGen] Unify scalar low-level types --- backend/include/rcc/CodeGen/TargetCallLowering.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'backend/include/rcc/CodeGen/TargetCallLowering.h') diff --git a/backend/include/rcc/CodeGen/TargetCallLowering.h b/backend/include/rcc/CodeGen/TargetCallLowering.h index 9d9b98b..21b5407 100644 --- a/backend/include/rcc/CodeGen/TargetCallLowering.h +++ b/backend/include/rcc/CodeGen/TargetCallLowering.h @@ -33,6 +33,14 @@ enum class ABIExtensionKind : std::uint8_t { Count, }; +enum class ABIValueCategory : std::uint8_t { + Invalid, + Integer, + FloatingPoint, + Pointer, + Count, +}; + enum class ABIValueFlag : std::uint8_t { ByVal, StructReturn, @@ -71,7 +79,8 @@ private: struct ABIValue final { Register Value; - LLT Type; + LowLevelType Type; + ABIValueCategory Category = ABIValueCategory::Invalid; std::uint32_t OriginalValue = 0; std::uint16_t FragmentIndex = 0; std::uint16_t FragmentCount = 1; @@ -222,8 +231,8 @@ struct CCAssignment final { std::uint32_t OriginalValueIndex = 0; std::uint16_t FragmentIndex = 0; std::uint16_t FragmentCount = 1; - LLT ValueType; - LLT LocationType; + LowLevelType ValueType; + LowLevelType LocationType; CCLocationKind LocationKind = CCLocationKind::Register; std::optional LocationRegister; std::optional StackOffsetBytes; @@ -279,7 +288,7 @@ struct VarArgLoweringState final { struct ByValCopyAssignment final { std::size_t ArgumentAssignmentIndex = 0; Register Source; - LLT PointerType; + LowLevelType PointerType; std::uint64_t StackOffsetBytes = 0; std::uint64_t SizeBytes = 0; Alignment Align; -- cgit v1.2.3