From 76d89700953ddd81cf31ab8f260eddf67e93aa85 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Fri, 7 Aug 2026 01:27:41 +0800 Subject: [MIR] Complete document parsing and printing Implement the single LLVM-compatible MIR document path with structured\nembedded-IR references, YAML mappings, constants, and deterministic printing.\n\nKeep pointer LLT widths DataLayout-derived, reject layout-dependent output\nwhen embedded IR is omitted, and record the fixed-baseline compatibility\ncontract and regression coverage. --- backend/include/rcc/MIR/MIParser.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'backend/include/rcc/MIR/MIParser.h') diff --git a/backend/include/rcc/MIR/MIParser.h b/backend/include/rcc/MIR/MIParser.h index 978e928..116a97f 100644 --- a/backend/include/rcc/MIR/MIParser.h +++ b/backend/include/rcc/MIR/MIParser.h @@ -5,15 +5,18 @@ #include "rcc/CodeGen/MachineIRTypes.h" #include "rcc/CodeGen/MachineMetadata.h" +#include "rcc/CodeGen/Register.h" #include "rcc/Support/Error.h" #include "rcc/Support/TextDiagnostic.h" #include #include +#include #include #include #include #include +#include #include namespace rcc { @@ -23,6 +26,11 @@ class TargetDescription; namespace mir { +struct MIVirtualRegisterSlot final { + std::uint32_t TextID = 0; + Register Reg; +}; + struct MIFrameObjectSlot final { std::uint32_t TextID = 0; FrameIndex Index; @@ -50,12 +58,15 @@ struct MISyncScopeSlot final { }; struct MIParserContext final { + std::vector VirtualRegisters; std::vector StackObjects; std::vector FixedStackObjects; std::vector ConstantPoolItems; std::vector JumpTables; std::vector Metadata; std::vector SyncScopes; + std::function(std::string_view)> InternSyncScope; + std::function(std::uint32_t)> PointerSizeInBits; std::uint32_t DefaultPointerSizeInBits = 0; }; @@ -66,6 +77,7 @@ struct MIParserOptions final { std::size_t MaximumInstructions = std::size_t{1} << 24U; std::size_t MaximumOperandsPerInstruction = std::size_t{1} << 20U; std::size_t MaximumMemoryOperandsPerInstruction = std::size_t{1} << 20U; + bool VerifyAfterParse = true; }; class MIParser final { -- cgit v1.2.3