aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/MIR/MIRFrameParser.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-11 17:37:42 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-11 17:37:42 +0800
commit6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0 (patch)
treef363c502f0e2b9cda2f12928049275a433db6ad4 /backend/lib/MIR/MIRFrameParser.cpp
parentadcf8c9b1bd1b47e00bf859693112cea1f7e8c9f (diff)
downloadrcc-project-6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0.tar.gz
rcc-project-6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0.tar.xz
[MIR] Accept fixed-baseline LLVM syntax
Diffstat (limited to 'backend/lib/MIR/MIRFrameParser.cpp')
-rw-r--r--backend/lib/MIR/MIRFrameParser.cpp12
1 files changed, 11 insertions, 1 deletions
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<std::uint32_t>::max()) {
return fail(Value->range(), "maximum call-frame size is outside the 32-bit unsigned range");
}
- State.MaxCallFrameSize = Size;
+ if (Size == std::numeric_limits<std::uint32_t>::max())
+ State.MaxCallFrameSize.reset();
+ else
+ State.MaxCallFrameSize = Size;
}
for (const auto &[Key, Destination] :
{std::pair{"cvBytesOfCalleeSavedRegisters", &State.CVBytesOfCalleeSavedRegisters},