[Mlir-commits] [mlir] a7cac0d - Fix Dialect doc generation to special case for the Builtin dialect empty name

Mehdi Amini llvmlistbot at llvm.org
Fri Mar 5 15:47:59 PST 2021


Author: Mehdi Amini
Date: 2021-03-05T23:47:50Z
New Revision: a7cac0d9a5034d72cff7ce615415c3c42cc4c4b8

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

LOG: Fix Dialect doc generation to special case for the Builtin dialect empty name

This should fix the issue with an empty entry for the builtin dialect on
the website.

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

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 bc130ecd5e52..45325deb2b79 100644
--- a/mlir/tools/mlir-tblgen/OpDocGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDocGen.cpp
@@ -221,7 +221,12 @@ static void emitTypeDefDoc(TypeDef td, raw_ostream &os) {
 static void emitDialectDoc(const Dialect &dialect, ArrayRef<Operator> ops,
                            ArrayRef<Type> types, ArrayRef<TypeDef> typeDefs,
                            raw_ostream &os) {
-  os << "# '" << dialect.getName() << "' Dialect\n\n";
+  os << "# ";
+  if (dialect.getName().empty())
+    os << "Builtin";
+  else
+    os << "'" << dialect.getName() << "'";
+  os << " Dialect\n\n";
   emitIfNotEmpty(dialect.getSummary(), os);
   emitIfNotEmpty(dialect.getDescription(), os);
 


        


More information about the Mlir-commits mailing list