Skip to content

[MLIR][doc] Fix docs for IRDL using -gen-dialect-doc #125195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

RoboTux
Copy link
Contributor

@RoboTux RoboTux commented Jan 31, 2025

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-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.
@llvmbot
Copy link
Member

llvmbot commented Jan 31, 2025

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-irdl

Author: Thomas Preud'homme (RoboTux)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/125195.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/IRDL/IR/CMakeLists.txt (+1-1)
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)

Copy link
Contributor

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@math-fehr math-fehr merged commit 4378ec7 into llvm:main Jan 31, 2025
11 checks passed
@RoboTux RoboTux deleted the fix_irdl_doc_generation branch January 31, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants