[Mlir-commits] [mlir] [MLIR] Add option to postpone remark emission (PR #157434)

Mehdi Amini llvmlistbot at llvm.org
Tue Sep 16 03:33:22 PDT 2025


================
@@ -60,22 +60,27 @@ struct RemarkOpts {
   StringRef categoryName;    // Category name (subject to regex filtering)
   StringRef subCategoryName; // Subcategory name
   StringRef functionName;    // Function name if available
+  bool postponed = false;    // Postpone showing the remark
 
   // Construct RemarkOpts from a remark name.
   static constexpr RemarkOpts name(StringRef n) {
-    return RemarkOpts{n, {}, {}, {}};
+    return RemarkOpts{n, {}, {}, {}, false};
   }
   /// Return a copy with the category set.
   constexpr RemarkOpts category(StringRef v) const {
-    return {remarkName, v, subCategoryName, functionName};
+    return {remarkName, v, subCategoryName, functionName, postponed};
   }
   /// Return a copy with the subcategory set.
   constexpr RemarkOpts subCategory(StringRef v) const {
-    return {remarkName, categoryName, v, functionName};
+    return {remarkName, categoryName, v, functionName, postponed};
   }
   /// Return a copy with the function name set.
   constexpr RemarkOpts function(StringRef v) const {
-    return {remarkName, categoryName, subCategoryName, v};
+    return {remarkName, categoryName, subCategoryName, v, postponed};
+  }
+  /// Return a copy with the postponed flag set.
----------------
joker-eph wrote:

This is the public API users are interacting with I believe, so it would be good to document more the context around this option. This sentence is kind of paraphrasing the API name, without really telling the user what is the effect or when/why they would use it.

Which also hint that we're missing the general documentation update (the markdown for the remark feature).



https://github.com/llvm/llvm-project/pull/157434


More information about the Mlir-commits mailing list