diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-02 02:56:39 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-02 02:56:39 +0800 |
| commit | 49d70380a6a95e4039f6b5e5ccce09671d5b4796 (patch) | |
| tree | c5a265f074ff4fa041b03745cc60218bb9f48a5d /backend/lib/CodeGen/MachineFunctionCloner.cpp | |
| parent | e0c77d80585428818c32886eb8c26755ea8ed159 (diff) | |
| download | rcc-project-49d70380a6a95e4039f6b5e5ccce09671d5b4796.tar.gz rcc-project-49d70380a6a95e4039f6b5e5ccce09671d5b4796.tar.xz | |
[CodeGen] Add machine metadata graphs
Model ordered function-local metadata tuples with explicit embedded-IR and MachineFunction reference scopes. Preserve slot zero, distinct nodes, forward references, and cyclic graphs while verifying function-local closure and cloning the graph deterministically.
Diffstat (limited to 'backend/lib/CodeGen/MachineFunctionCloner.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineFunctionCloner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/MachineFunctionCloner.cpp b/backend/lib/CodeGen/MachineFunctionCloner.cpp index 2f99341..e12e33e 100644 --- a/backend/lib/CodeGen/MachineFunctionCloner.cpp +++ b/backend/lib/CodeGen/MachineFunctionCloner.cpp @@ -626,6 +626,10 @@ Expected<MachineFunctionCloneResult> cloneMachineFunction(const MachineFunction if (!Records) return std::unexpected(Records.error()); Result.ClonedFunction->records() = std::move(*Records); + auto Metadata = Source.metadata().clone(); + if (!Metadata) + return std::unexpected(Metadata.error()); + Result.ClonedFunction->metadata() = std::move(*Metadata); Result.ClonedFunction->properties() = Source.properties(); Result.ClonedFunction->attributes() = Source.attributes(); auto DestinationVerification = MachineVerifier::verify(*Result.ClonedFunction, Target); |
