[Mlir-commits] [mlir] 6990411 - [mlir] Fix emitting attribute documentation

Marius Brehler llvmlistbot at llvm.org
Wed Feb 24 23:23:56 PST 2021


Author: Marius Brehler
Date: 2021-02-25T08:23:50+01:00
New Revision: 699041123eba13a2d5ee253eeeaeb15893d21ce7

URL: https://github.com/llvm/llvm-project/commit/699041123eba13a2d5ee253eeeaeb15893d21ce7
DIFF: https://github.com/llvm/llvm-project/commit/699041123eba13a2d5ee253eeeaeb15893d21ce7.diff

LOG: [mlir] Fix emitting attribute documentation

This fixes the documentation emitted for type parameters. Also adds a
missing empty line, rendered as line break in mark down.

Co-authored-by: Simon Camphausen <simon.camphausen at iml.fraunhofer.de>

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97267

Added: 
    

Modified: 
    mlir/tools/mlir-tblgen/OpDocGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/OpDocGen.cpp b/mlir/tools/mlir-tblgen/OpDocGen.cpp
index 36fc6306b086..c1a25bd506fd 100644
--- a/mlir/tools/mlir-tblgen/OpDocGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDocGen.cpp
@@ -192,8 +192,10 @@ static void emitTypeDefDoc(TypeDef td, raw_ostream &os) {
   if (td.getMnemonic() && td.getPrinterCode() && *td.getPrinterCode() == "" &&
       td.getParserCode() && *td.getParserCode() == "")
     emitTypeAssemblyFormat(td, os);
-  if (td.hasDescription())
+  if (td.hasDescription()) {
+    os << "\n";
     mlir::tblgen::emitDescription(td.getDescription(), os);
+  }
 
   // Emit attribute documentation.
   SmallVector<TypeParameter, 4> parameters;
@@ -204,7 +206,7 @@ static void emitTypeDefDoc(TypeDef td, raw_ostream &os) {
        << "| :-------: | :-------: | ----------- |\n";
     for (const auto &it : parameters) {
       auto desc = it.getSummary();
-      os << "| " << it.getName() << " | `" << td.getCppClassName() << "` | "
+      os << "| " << it.getName() << " | `" << it.getCppType() << "` | "
          << (desc ? *desc : "") << " |\n";
     }
   }


        


More information about the Mlir-commits mailing list