diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-25 02:21:25 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-25 02:21:25 +0800 |
| commit | 71988f9818677df0d90b19d4bb770ac8a6116e62 (patch) | |
| tree | abc6a548dc50fefd1e2882fd33fe652776c0bb6a /backend/lib/CodeGen/MIRYamlMapping.cpp | |
| parent | 6dc798fbdbef20670317742a8c1d12f47e9d1c05 (diff) | |
| download | rcc-project-71988f9818677df0d90b19d4bb770ac8a6116e62.tar.gz rcc-project-71988f9818677df0d90b19d4bb770ac8a6116e62.tar.xz | |
[CodeGen] Implement RISC-V machine outlining
Diffstat (limited to 'backend/lib/CodeGen/MIRYamlMapping.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MIRYamlMapping.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/lib/CodeGen/MIRYamlMapping.cpp b/backend/lib/CodeGen/MIRYamlMapping.cpp index cd94fc6..c36f006 100644 --- a/backend/lib/CodeGen/MIRYamlMapping.cpp +++ b/backend/lib/CodeGen/MIRYamlMapping.cpp @@ -1009,14 +1009,16 @@ Expected<void> verifyMIRDocumentReferences(const MIRDocument &Document, } else { IRFunction = Embedded->function(Function.name()); } - if (IRFunction == nullptr) { + if (IRFunction == nullptr && !Function.attributes().has(MachineFunctionAttribute::IsOutlined)) { return makeUnexpected(ErrorCode::VerificationError, "machine function has no matching embedded LLVM IR function"); } } - const auto ValidateGlobal = [Embedded](std::string_view Name, - std::string_view Description) -> Expected<void> { + const auto ValidateGlobal = + [&Document, Embedded](std::string_view Name, std::string_view Description) -> Expected<void> { + if (Document.unit().function(Name) != nullptr) + return {}; if (Embedded == nullptr) { return makeUnexpected(ErrorCode::VerificationError, std::string(Description) + |
