Skip to content

Commit b1c9fdd

Browse files
committed
remove shutdown
1 parent e94554b commit b1c9fdd

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

mlir/include/mlir/IR/Remarks.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,16 +429,17 @@ class RemarkEngine {
429429
/// main remark streamer.
430430
~RemarkEngine();
431431

432-
/// Shutdown the remark engine. This will finalize the remark engine and
433-
/// close the output file.
434-
void shutdown();
435-
436432
/// Setup the remark engine with the given output path and format.
437433
LogicalResult
438434
initialize(std::unique_ptr<MLIRRemarkStreamerBase> streamer,
439435
std::unique_ptr<RemarkEmittingPolicyBase> remarkEmittingPolicy,
440436
std::string *errMsg);
441437

438+
/// Get the remark emitting policy.
439+
RemarkEmittingPolicyBase *getRemarkEmittingPolicy() const {
440+
return remarkEmittingPolicy.get();
441+
}
442+
442443
/// Report a remark.
443444
void report(const Remark &&remark);
444445

mlir/lib/IR/Remarks.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,6 @@ void RemarkEngine::reportImpl(const Remark &remark) {
237237
emitRemark(remark.getLocation(), remark.getMsg());
238238
}
239239

240-
void RemarkEngine::shutdown() {
241-
if (remarkEmittingPolicy) {
242-
remarkEmittingPolicy->finalize();
243-
}
244-
}
245-
246240
void RemarkEngine::report(const Remark &&remark) {
247241
if (remarkEmittingPolicy)
248242
remarkEmittingPolicy->reportRemark(remark);

mlir/lib/Tools/mlir-opt/MlirOptMain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,8 @@ performActions(raw_ostream &os,
618618
os << OpWithState(op.get(), asmState) << '\n';
619619

620620
if (remark::detail::RemarkEngine *engine = ctx.getRemarkEngine())
621-
engine->shutdown();
621+
engine->getRemarkEmittingPolicy()->finalize();
622+
622623
return success();
623624
}
624625

mlir/unittests/IR/RemarkTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ TEST(Remark, TestRemarkFinal) {
374374
<< pass4Msg;
375375

376376
// Finalize the remark engine
377-
context.getRemarkEngine()->shutdown();
377+
policy->finalize();
378378
}
379379

380380
llvm::errs().flush();

0 commit comments

Comments
 (0)