From 8be4d04455f70892a94d1e0798e266c948b4750a Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Fri, 14 Aug 2026 04:33:41 +0800 Subject: [CodeGen] Match LLVM Legalizer ownership --- backend/lib/CodeGen/InstructionDescriptor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'backend/lib/CodeGen/InstructionDescriptor.cpp') diff --git a/backend/lib/CodeGen/InstructionDescriptor.cpp b/backend/lib/CodeGen/InstructionDescriptor.cpp index d164cde..027f738 100644 --- a/backend/lib/CodeGen/InstructionDescriptor.cpp +++ b/backend/lib/CodeGen/InstructionDescriptor.cpp @@ -302,6 +302,19 @@ struct OperandShape final { } // namespace +Expected> +resolveExplicitOperandDescriptors(const InstructionDescriptor &Descriptor, + std::size_t OperandCount) { + auto Shape = resolveOperandShape(Descriptor, OperandCount); + if (!Shape) + return std::unexpected(Shape.error()); + std::vector Result; + Result.reserve(OperandCount); + for (std::size_t Index = 0; Index < OperandCount; ++Index) + Result.push_back(&descriptorForOperand(Descriptor, *Shape, Index)); + return Result; +} + OperandKindSet::OperandKindSet(std::initializer_list Kinds) noexcept { for (const MachineOperand::Kind Kind : Kinds) add(Kind); -- cgit v1.2.3