[Mlir-commits] [mlir] [mlir][doc] Emit `\n` if description not end with `\n`. (PR #112898)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Oct 18 05:54:22 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
Author: Longsheng Mou (CoTinker)
<details>
<summary>Changes</summary>
This PR addresses a markdown formatting issue by ensuring a `\n` is emitted if the description string does not already end with one. Fixes #<!-- -->112672.
---
Full diff: https://github.com/llvm/llvm-project/pull/112898.diff
1 Files Affected:
- (modified) mlir/tools/mlir-tblgen/OpDocGen.cpp (+4-1)
``````````diff
diff --git a/mlir/tools/mlir-tblgen/OpDocGen.cpp b/mlir/tools/mlir-tblgen/OpDocGen.cpp
index ff3c6b16bb6ebc..d499c78a5cf44d 100644
--- a/mlir/tools/mlir-tblgen/OpDocGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDocGen.cpp
@@ -70,7 +70,10 @@ void mlir::tblgen::emitSummary(StringRef summary, raw_ostream &os) {
// nested in the op definition.
void mlir::tblgen::emitDescription(StringRef description, raw_ostream &os) {
raw_indented_ostream ros(os);
- ros.printReindented(description.rtrim(" \t"));
+ StringRef trimmed = description.rtrim(" \t");
+ ros.printReindented(trimmed);
+ if (!trimmed.ends_with("\n"))
+ ros << "\n";
}
void mlir::tblgen::emitDescriptionComment(StringRef description,
``````````
</details>
https://github.com/llvm/llvm-project/pull/112898
More information about the Mlir-commits
mailing list