From a8a9d7d926202450645deae872d4d9dc11d63215 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 2 Aug 2026 03:37:46 +0800 Subject: [CodeGen] Model machine debug metadata Replace marker-based metadata operands with scoped references and inline DIExpression values. Add structured DILocation chains, instruction debug attachments, stack variable records, and entry values with unified verification, builder support, and deterministic cloning. --- backend/include/rcc/CodeGen/MachineIRBuilder.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'backend/include/rcc/CodeGen/MachineIRBuilder.h') diff --git a/backend/include/rcc/CodeGen/MachineIRBuilder.h b/backend/include/rcc/CodeGen/MachineIRBuilder.h index 08ec9ba..918f389 100644 --- a/backend/include/rcc/CodeGen/MachineIRBuilder.h +++ b/backend/include/rcc/CodeGen/MachineIRBuilder.h @@ -70,7 +70,8 @@ public: std::uint32_t TargetFlags = 0); [[nodiscard]] Expected addRegisterMask(std::shared_ptr Mask, std::uint32_t TargetFlags = 0); - [[nodiscard]] Expected addMetadata(std::string Marker, std::uint32_t TargetFlags = 0); + [[nodiscard]] Expected addMetadata(MachineMetadataValue Value, + std::uint32_t TargetFlags = 0); [[nodiscard]] Expected addTargetIndex(TargetIndex Index, std::int64_t Offset = 0, std::uint32_t TargetFlags = 0); [[nodiscard]] Expected addMCSymbol(std::string Name, std::int64_t Offset = 0, @@ -83,6 +84,8 @@ public: [[nodiscard]] Expected setSourceLocation(SourceLocation NewLocation); [[nodiscard]] Expected clearSourceLocation(); + [[nodiscard]] Expected setDebugLocation(MachineDebugLocation NewLocation); + [[nodiscard]] Expected clearDebugLocation(); [[nodiscard]] Expected setOrigin(OriginID NewOrigin); [[nodiscard]] Expected clearOrigin(); @@ -116,6 +119,7 @@ private: std::vector MemOperands; MachineInstrFlags Flags; std::optional Location; + std::optional DebugLocation; std::optional Origin; bool IsBuilt = false; -- cgit v1.2.3