Skip to content

Commit 5c6aaa0

Browse files
committed
keep public api same
1 parent 6c5a3bc commit 5c6aaa0

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

mlir/include/mlir/IR/Remarks.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ class RemarkEngine {
408408
/// Emit all postponed remarks.
409409
void emitPostponedRemarks();
410410

411+
/// Report a remark. When `forcePrintPostponedRemarks` is true, the remark
412+
/// will be printed even if it is postponed.
413+
void report(const Remark &remark, bool forcePrintPostponedRemarks);
414+
411415
public:
412416
/// Default constructor is deleted, use the other constructor.
413417
RemarkEngine() = delete;
@@ -426,7 +430,7 @@ class RemarkEngine {
426430
std::string *errMsg);
427431

428432
/// Report a remark.
429-
void report(const Remark &remark, bool ignorePostpone = false);
433+
void report(const Remark &remark);
430434

431435
/// Report a successful remark, this will create an InFlightRemark
432436
/// that can be used to build the remark using the << operator.

mlir/lib/IR/Remarks.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ llvm::remarks::Remark Remark::generateRemark() const {
157157

158158
InFlightRemark::~InFlightRemark() {
159159
if (remark && owner)
160-
owner->report(std::move(*remark));
160+
owner->report(*remark);
161161
owner = nullptr;
162162
}
163163

@@ -225,9 +225,10 @@ InFlightRemark RemarkEngine::emitOptimizationRemarkAnalysis(Location loc,
225225
// RemarkEngine
226226
//===----------------------------------------------------------------------===//
227227

228-
void RemarkEngine::report(const Remark &remark, bool ignorePostpone) {
228+
void RemarkEngine::report(const Remark &remark,
229+
bool forcePrintPostponedRemarks) {
229230
// Postponed remarks are shown at the end of pipeline, unless overridden.
230-
if (remark.isPostponed() && !ignorePostpone) {
231+
if (remark.isPostponed() && !forcePrintPostponedRemarks) {
231232
postponedRemarks.push_back(remark);
232233
return;
233234
}
@@ -241,9 +242,13 @@ void RemarkEngine::report(const Remark &remark, bool ignorePostpone) {
241242
emitRemark(remark.getLocation(), remark.getMsg());
242243
}
243244

245+
void RemarkEngine::report(const Remark &remark) {
246+
report(remark, /*forcePrintPostponedRemarks=*/false);
247+
}
248+
244249
void RemarkEngine::emitPostponedRemarks() {
245250
for (auto &remark : postponedRemarks)
246-
report(remark, /*ignorePostpone=*/true);
251+
report(remark, /*forcePrintPostponedRemarks=*/true);
247252
postponedRemarks.clear();
248253
}
249254

0 commit comments

Comments
 (0)