[all-commits] [llvm/llvm-project] e9869b: [mlir][docgen] Add ops source link (#73657)

Rik Huijzer via All-commits all-commits at lists.llvm.org
Thu Nov 30 01:30:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9869b57707fc6dd828872a70c2f377cc0061978
      https://github.com/llvm/llvm-project/commit/e9869b57707fc6dd828872a70c2f377cc0061978
  Author: Rik Huijzer <github at huijzer.xyz>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

  Changed paths:
    M mlir/test/mlir-tblgen/gen-dialect-doc.td
    M mlir/tools/mlir-tblgen/OpDocGen.cpp

  Log Message:
  -----------
  [mlir][docgen] Add ops source link (#73657)

This patch suggests to change two things. Firstly, it adds a source link
above the generated operations docs (above the `emitOpDoc` calls). This
link will point directly to the source TableGen file for the group of
operations. For example, for the current
[`amdgpu`](https://mlir.llvm.org/docs/Dialects/AMDGPU/) page, the link
will add a source link below the "Operation definition" heading pointing
to
[`mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td`](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td).
The link is wrapped in a "op-definitions-source-link" class which could
allow for custom styling, but it also looks reasonable without custom
styling I think:

![afbeelding](https://github.com/llvm/llvm-project/assets/20724914/7c0e59b9-b14b-4f5d-a671-c87e857a7b03)

Secondly, this patch simplifies the header names such as "Operation
definition" and "Attribute definition" to "Operations" and "Attributes"
respectively. This is in line with manually defined subheadings on pages
such as the one for the
[`vector`](https://mlir.llvm.org/docs/Dialects/Vector/#operations)
dialect.




More information about the All-commits mailing list