diff options
Diffstat (limited to 'backend/lib/CodeGen/MachineMemoryFolding.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineMemoryFolding.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/backend/lib/CodeGen/MachineMemoryFolding.cpp b/backend/lib/CodeGen/MachineMemoryFolding.cpp index e3d796a..75200f8 100644 --- a/backend/lib/CodeGen/MachineMemoryFolding.cpp +++ b/backend/lib/CodeGen/MachineMemoryFolding.cpp @@ -42,11 +42,6 @@ namespace { return Contract; } -[[nodiscard]] Error prefixedError(const Error &Failure, std::string Prefix) { - Prefix.append(Failure.message()); - return Error(Failure.code(), std::move(Prefix)); -} - [[nodiscard]] bool hasProtectedAttachment(const MachineInstr &Instruction) noexcept { return Instruction.debugInstrNumber() != 0 || Instruction.preInstrSymbol().has_value() || Instruction.postInstrSymbol().has_value() || Instruction.heapAllocMarker().has_value() || @@ -195,14 +190,14 @@ Expected<MachinePassResult> MachineMemoryFoldingPass::run(MachineFunction &Funct MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt}); if (!Trial) { return std::unexpected( - prefixedError(Trial.error(), "memory folding transaction setup failed: ")); + withErrorContext(Trial.error(), "memory folding transaction setup failed: ")); } auto TrialResult = runImplementation(*Trial->ClonedFunction, Target); if (!TrialResult) return std::unexpected(TrialResult.error()); auto Result = runImplementation(Function, Target); if (!Result) { - return std::unexpected(prefixedError( + return std::unexpected(withErrorContext( Result.error(), "memory folding diverged after a successful transaction preflight: ")); } return Result; |
