aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachineStackSlotColoring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/MachineStackSlotColoring.cpp')
-rw-r--r--backend/lib/CodeGen/MachineStackSlotColoring.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/backend/lib/CodeGen/MachineStackSlotColoring.cpp b/backend/lib/CodeGen/MachineStackSlotColoring.cpp
index 005872b..7a65eb3 100644
--- a/backend/lib/CodeGen/MachineStackSlotColoring.cpp
+++ b/backend/lib/CodeGen/MachineStackSlotColoring.cpp
@@ -41,11 +41,6 @@ namespace {
return Contract;
}
-[[nodiscard]] Error prefixedError(const Error &Failure, std::string Prefix) {
- Prefix.append(Failure.message());
- return Error(Failure.code(), std::move(Prefix));
-}
-
struct SlotInterval final {
MachineBasicBlock *Block = nullptr;
std::size_t First = 0;
@@ -242,14 +237,14 @@ Expected<MachinePassResult> MachineStackSlotColoringPass::run(MachineFunction &F
MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt});
if (!Trial) {
return std::unexpected(
- prefixedError(Trial.error(), "stack-slot coloring transaction setup failed: "));
+ withErrorContext(Trial.error(), "stack-slot coloring transaction setup failed: "));
}
auto TrialResult = runImplementation(*Trial->ClonedFunction);
if (!TrialResult)
return std::unexpected(TrialResult.error());
auto Result = runImplementation(Function);
if (!Result) {
- return std::unexpected(prefixedError(
+ return std::unexpected(withErrorContext(
Result.error(), "stack-slot coloring diverged after a successful transaction preflight: "));
}
return Result;