[Mlir-commits] [mlir] [MLIR][doc] Fix docs for IRDL using -gen-dialect-doc (PR #125195)

Thomas Preud'homme llvmlistbot at llvm.org
Fri Jan 31 02:16:43 PST 2025


https://github.com/RoboTux created https://github.com/llvm/llvm-project/pull/125195

mlir-tblgen fails to generate doc for IRDL because while parsing IRDL.td
it also finds the definition of the builtin dialect and cannot determine
what dialect to generate documentation for. This is because IRDL.td
includes IRDLOps.td which includes BuiltinAttributes.td which in turns
includes BuiltinDialect.td.


>From 90d1487515863d95b69c8b0c366ccbaeafb64793 Mon Sep 17 00:00:00 2001
From: Thomas Preud'homme <thomas.preudhomme at arm.com>
Date: Fri, 31 Jan 2025 09:51:11 +0000
Subject: [PATCH] [MLIR][doc] Fix docs for IRDL using -gen-dialect-doc

mlir-tblgen fails to generate doc for IRDL because while parsing IRDL.td
it also finds the definition of the builtin dialect and cannot determine
what dialect to generate documentation for. This is because IRDL.td
includes IRDLOps.td which includes BuiltinAttributes.td which in turns
includes BuiltinDialect.td.
---
 mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
index ec3e06bedae038..861db0ca96671d 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_mlir_dialect(IRDL irdl)
-add_mlir_doc(IRDLOps IRDL Dialects/ -gen-dialect-doc)
+add_mlir_doc(IRDLOps IRDL Dialects/ -gen-dialect-doc -dialect=irdl)
 
 # Add IRDL interfaces
 set(LLVM_TARGET_DEFINITIONS IRDLInterfaces.td)



More information about the Mlir-commits mailing list