aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/MachineIRBuilder.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-02 03:37:46 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-02 03:37:46 +0800
commita8a9d7d926202450645deae872d4d9dc11d63215 (patch)
tree16a3640a93e3f567ff31045969c02a42e1f467e0 /backend/include/rcc/CodeGen/MachineIRBuilder.h
parent49d70380a6a95e4039f6b5e5ccce09671d5b4796 (diff)
downloadrcc-project-a8a9d7d926202450645deae872d4d9dc11d63215.tar.gz
rcc-project-a8a9d7d926202450645deae872d4d9dc11d63215.tar.xz
[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.
Diffstat (limited to 'backend/include/rcc/CodeGen/MachineIRBuilder.h')
-rw-r--r--backend/include/rcc/CodeGen/MachineIRBuilder.h6
1 files changed, 5 insertions, 1 deletions
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<void> addRegisterMask(std::shared_ptr<const RegisterMask> Mask,
std::uint32_t TargetFlags = 0);
- [[nodiscard]] Expected<void> addMetadata(std::string Marker, std::uint32_t TargetFlags = 0);
+ [[nodiscard]] Expected<void> addMetadata(MachineMetadataValue Value,
+ std::uint32_t TargetFlags = 0);
[[nodiscard]] Expected<void> addTargetIndex(TargetIndex Index, std::int64_t Offset = 0,
std::uint32_t TargetFlags = 0);
[[nodiscard]] Expected<void> addMCSymbol(std::string Name, std::int64_t Offset = 0,
@@ -83,6 +84,8 @@ public:
[[nodiscard]] Expected<void> setSourceLocation(SourceLocation NewLocation);
[[nodiscard]] Expected<void> clearSourceLocation();
+ [[nodiscard]] Expected<void> setDebugLocation(MachineDebugLocation NewLocation);
+ [[nodiscard]] Expected<void> clearDebugLocation();
[[nodiscard]] Expected<void> setOrigin(OriginID NewOrigin);
[[nodiscard]] Expected<void> clearOrigin();
@@ -116,6 +119,7 @@ private:
std::vector<const MachineMemOperand *> MemOperands;
MachineInstrFlags Flags;
std::optional<SourceLocation> Location;
+ std::optional<MachineDebugLocation> DebugLocation;
std::optional<OriginID> Origin;
bool IsBuilt = false;