aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/PostRAScheduler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/PostRAScheduler.cpp')
-rw-r--r--backend/lib/CodeGen/PostRAScheduler.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/backend/lib/CodeGen/PostRAScheduler.cpp b/backend/lib/CodeGen/PostRAScheduler.cpp
index b5f7ae9..fede8df 100644
--- a/backend/lib/CodeGen/PostRAScheduler.cpp
+++ b/backend/lib/CodeGen/PostRAScheduler.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));
-}
-
} // namespace
const MachinePassContract &PostRASchedulerPass::contract() const noexcept {
@@ -72,7 +67,7 @@ Expected<MachinePassResult> PostRASchedulerPass::run(MachineFunction &Function,
MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt});
if (!Trial) {
return std::unexpected(
- prefixedError(Trial.error(), "post-RA scheduler transaction setup failed: "));
+ withErrorContext(Trial.error(), "post-RA scheduler transaction setup failed: "));
}
MachineFunctionAnalysisManager TrialAnalyses;
auto TrialLiveness =
@@ -104,7 +99,7 @@ Expected<MachinePassResult> PostRASchedulerPass::run(MachineFunction &Function,
auto Run = runMachineScheduler(Function, Target, *Model, ScheduleDAGMode::PostRegisterAllocation,
**Liveness, **Frequencies, Options, &Actions);
if (!Run) {
- return std::unexpected(prefixedError(
+ return std::unexpected(withErrorContext(
Run.error(), "post-RA scheduler diverged after a successful transaction preflight: "));
}
auto Replayed = Actions.finishReplay();