Skip to content

Commit c18f3a9

Browse files
Address review feedback
1 parent 7d11a48 commit c18f3a9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

clang/lib/CIR/Dialect/Transforms/GotoSolver.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//====- GotoSolver.cpp -----------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
18
#include "PassDetail.h"
29
#include "clang/CIR/Dialect/IR/CIRDialect.h"
310
#include "clang/CIR/Dialect/Passes.h"
@@ -10,13 +17,11 @@ using namespace cir;
1017
namespace {
1118

1219
struct GotoSolverPass : public GotoSolverBase<GotoSolverPass> {
13-
1420
GotoSolverPass() = default;
1521
void runOnOperation() override;
1622
};
1723

1824
static void process(cir::FuncOp func) {
19-
2025
mlir::OpBuilder rewriter(func.getContext());
2126
llvm::StringMap<Block *> labels;
2227
llvm::SmallVector<cir::GotoOp, 4> gotos;
@@ -35,14 +40,14 @@ static void process(cir::FuncOp func) {
3540
mlir::OpBuilder::InsertionGuard guard(rewriter);
3641
rewriter.setInsertionPoint(goTo);
3742
Block *dest = labels[goTo.getLabel()];
38-
rewriter.create<cir::BrOp>(goTo.getLoc(), dest);
43+
cir::BrOp::create(rewriter, goTo.getLoc(), dest);
3944
goTo.erase();
4045
}
4146
}
4247

4348
void GotoSolverPass::runOnOperation() {
4449
llvm::TimeTraceScope scope("Goto Solver");
45-
getOperation()->walk([&](cir::FuncOp op) { process(op); });
50+
getOperation()->walk(&process);
4651
}
4752

4853
} // namespace

0 commit comments

Comments
 (0)