diff options
Diffstat (limited to 'backend/lib/CodeGen/MachineScheduler.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineScheduler.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/backend/lib/CodeGen/MachineScheduler.cpp b/backend/lib/CodeGen/MachineScheduler.cpp index 82f0c91..58c909d 100644 --- a/backend/lib/CodeGen/MachineScheduler.cpp +++ b/backend/lib/CodeGen/MachineScheduler.cpp @@ -49,11 +49,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]] std::uint64_t saturatingAdd(std::uint64_t Left, std::uint64_t Right) noexcept { return std::numeric_limits<std::uint64_t>::max() - Left < Right ? std::numeric_limits<std::uint64_t>::max() @@ -406,7 +401,7 @@ Expected<MachinePassResult> MachineSchedulerPass::run(MachineFunction &Function, MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt}); if (!Trial) { return std::unexpected( - prefixedError(Trial.error(), "machine scheduler transaction setup failed: ")); + withErrorContext(Trial.error(), "machine scheduler transaction setup failed: ")); } MachineFunctionAnalysisManager TrialAnalyses; auto TrialLiveness = @@ -434,7 +429,7 @@ Expected<MachinePassResult> MachineSchedulerPass::run(MachineFunction &Function, auto Run = runMachineScheduler(Function, Target, *Model, ScheduleDAGMode::PreRegisterAllocation, **Liveness, **Frequencies, Options, &Actions); if (!Run) { - return std::unexpected(prefixedError( + return std::unexpected(withErrorContext( Run.error(), "machine scheduler diverged after a successful transaction preflight: ")); } auto Replayed = Actions.finishReplay(); |
