From 540c73a2f450af3d0aec6e039fab054471efdbb1 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 24 Aug 2026 16:37:25 +0800 Subject: [RISCV] Match LLVM frame lowering semantics --- backend/lib/CodeGen/MIRPrinter.cpp | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'backend/lib/CodeGen/MIRPrinter.cpp') diff --git a/backend/lib/CodeGen/MIRPrinter.cpp b/backend/lib/CodeGen/MIRPrinter.cpp index c684368..4683a81 100644 --- a/backend/lib/CodeGen/MIRPrinter.cpp +++ b/backend/lib/CodeGen/MIRPrinter.cpp @@ -959,27 +959,9 @@ Expected MIRDocumentPrinter::printStackObjects(const MachineFunction &Func "stack object contains state not represented by fixed LLVM MIR"); } - std::string_view Type; - switch (Description->Kind) { - case StackObjectKind::Default: - case StackObjectKind::FixedABI: - Type = "default"; - break; - case StackObjectKind::FixedSpillSlot: - case StackObjectKind::SpillSlot: - Type = "spill-slot"; - break; - case StackObjectKind::VariableSized: - Type = "variable-sized"; - break; - case StackObjectKind::DynamicAlloca: - case StackObjectKind::CalleeSaved: - case StackObjectKind::EmergencySpill: - case StackObjectKind::Target: - case StackObjectKind::Count: - return makeUnexpected(ErrorCode::Unsupported, - "stack object kind has no fixed LLVM MIR representation"); - } + const std::string_view Type = Object->isSpill() ? "spill-slot" + : Object->isVariableSized() ? "variable-sized" + : "default"; Output.append(" - { id: "); Output.append(std::to_string(Slot.TextID)); -- cgit v1.2.3