diff options
Diffstat (limited to 'backend/lib/CodeGen/MachineTailMerge.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineTailMerge.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/backend/lib/CodeGen/MachineTailMerge.cpp b/backend/lib/CodeGen/MachineTailMerge.cpp index dc07950..7467993 100644 --- a/backend/lib/CodeGen/MachineTailMerge.cpp +++ b/backend/lib/CodeGen/MachineTailMerge.cpp @@ -50,11 +50,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() || @@ -307,14 +302,15 @@ Expected<MachinePassResult> MachineTailMergePass::run(MachineFunction &Function, Function, Target, MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt}); if (!Trial) { - return std::unexpected(prefixedError(Trial.error(), "tail merge transaction setup failed: ")); + return std::unexpected( + withErrorContext(Trial.error(), "tail merge 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(), "tail merge diverged after a successful transaction preflight: ")); } return Result; |
