From 6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Tue, 11 Aug 2026 17:37:42 +0800 Subject: [MIR] Accept fixed-baseline LLVM syntax --- backend/lib/MIR/MIRFrameParser.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'backend/lib/MIR/MIRFrameParser.cpp') diff --git a/backend/lib/MIR/MIRFrameParser.cpp b/backend/lib/MIR/MIRFrameParser.cpp index 76ace8f..9e21dfc 100644 --- a/backend/lib/MIR/MIRFrameParser.cpp +++ b/backend/lib/MIR/MIRFrameParser.cpp @@ -408,6 +408,13 @@ bool MIRDocumentParser::parseFrameState(const yaml::Node &Root, MachineFunction for (const auto &[Key, Destination] : {std::pair{"stackProtector", &State.StackProtector}, std::pair{"functionContext", &State.FunctionContext}}) { if (const yaml::Node *Value = mappingValue(*Frame, Key)) { + std::string_view Reference; + if (scalar(*Value, Reference, "frame index")) + return true; + if (Reference.empty()) { + Destination->reset(); + continue; + } FrameIndex Index; if (parseFrameReference(*Value, Context, Index)) return true; @@ -420,7 +427,10 @@ bool MIRDocumentParser::parseFrameState(const yaml::Node &Root, MachineFunction Size > std::numeric_limits::max()) { return fail(Value->range(), "maximum call-frame size is outside the 32-bit unsigned range"); } - State.MaxCallFrameSize = Size; + if (Size == std::numeric_limits::max()) + State.MaxCallFrameSize.reset(); + else + State.MaxCallFrameSize = Size; } for (const auto &[Key, Destination] : {std::pair{"cvBytesOfCalleeSavedRegisters", &State.CVBytesOfCalleeSavedRegisters}, -- cgit v1.2.3