Skip to content

Commit 6989c48

Browse files
authored
[Documentation] Fix some invalid references in sphinx documentation (#68239)
1 parent 236228f commit 6989c48

File tree

6 files changed

+63
-126
lines changed

6 files changed

+63
-126
lines changed

flang/docs/ComplexOperations.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Complex Operations
22

3-
```{eval-rst}
4-
.. toctree::
5-
:local:
3+
```{contents}
4+
---
5+
local:
6+
---
67
```
78

89
Fortran includes support for complex number types and a set of operators and
@@ -66,7 +67,7 @@ libm functions.
6667
6768
Similarly to the numerical lowering through the math dialect, certain MLIR
6869
optimisations could violate the precise floating point model, so when that is
69-
requested lowering manually emits calls to libm, rather than going through the
70+
requested lowering manually emits calls to libm, rather than going through the
7071
MLIR complex dialect.
7172
7273
The ComplexToStandard dialect does still call into libm for some floating

flang/docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
# Add any paths that contain templates here, relative to this directory.
3333
templates_path = ["_templates"]
34+
myst_heading_anchors = 6
3435

3536
import sphinx
3637

llvm/docs/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack.md

Lines changed: 32 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,10 @@
11
# Allow Location Descriptions on the DWARF Expression Stack <!-- omit in toc -->
22

3-
- [1. Extension](#extension)
4-
- [2. Heterogeneous Computing Devices](#heterogeneous-computing-devices)
5-
- [3. DWARF 5](#dwarf-5)
6-
- [3.1 How DWARF Maps Source Language To Hardware](#how-dwarf-maps-source-language-to-hardware)
7-
- [3.2 Examples](#examples)
8-
- [3.2.1 Dynamic Array Size](#dynamic-array-size)
9-
- [3.2.2 Variable Location in Register](#variable-location-in-register)
10-
- [3.2.3 Variable Location in Memory](#variable-location-in-memory)
11-
- [3.2.4 Variable Spread Across Different Locations](#variable-spread-across-different-locations)
12-
- [3.2.5 Offsetting a Composite Location](#offsetting-a-composite-location)
13-
- [3.2.6 Pointer to Member](#pointer-to-member)
14-
- [3.2.7 Virtual Base Class](#virtual-base-class)
15-
- [3.3 Limitations](#limitations)
16-
- [4. Extension Solution](#extension-solution)
17-
- [4.1 Location Description](#location-description)
18-
- [4.2 Stack Location Description Operations](#stack-location-description-operations)
19-
- [4.3 Examples](#examples-1)
20-
- [4.3.1 Source Language Variable Spilled to Part of a Vector Register](#source-language-variable-spilled-to-part-of-a-vector-register)
21-
- [4.3.2 Source Language Variable Spread Across Multiple Vector Registers](#source-language-variable-spread-across-multiple-vector-registers)
22-
- [4.3.3 Source Language Variable Spread Across Multiple Kinds of Locations](#source-language-variable-spread-across-multiple-kinds-of-locations)
23-
- [4.3.4 Address Spaces](#address-spaces)
24-
- [4.3.5 Bit Offsets](#bit-offsets)
25-
- [4.4 Call Frame Information (CFI)](#call-frame-information-cfi)
26-
- [4.5 Objects Not In Byte Aligned Global Memory](#objects-not-in-byte-aligned-global-memory)
27-
- [4.6 Higher Order Operations](#higher-order-operations)
28-
- [4.7 Objects In Multiple Places](#objects-in-multiple-places)
29-
- [5. Conclusion](#conclusion)
30-
- [A. Changes to DWARF Debugging Information Format Version 5](#a-changes-to-dwarf-debugging-information-format-version-5)
31-
- [A.2 General Description](#a-2-general-description)
32-
- [A.2.5 DWARF Expressions](#a-2-5-dwarf-expressions)
33-
- [A.2.5.1 DWARF Expression Evaluation Context](#a-2-5-1-dwarf-expression-evaluation-context)
34-
- [A.2.5.2 DWARF Expression Value](#a-2-5-2-dwarf-expression-value)
35-
- [A.2.5.3 DWARF Location Description](#a-2-5-3-dwarf-location-description)
36-
- [A.2.5.4 DWARF Operation Expressions](#a-2-5-4-dwarf-operation-expressions)
37-
- [A.2.5.4.1 Stack Operations](#a-2-5-4-1-stack-operations)
38-
- [A.2.5.4.2 Control Flow Operations](#a-2-5-4-2-control-flow-operations)
39-
- [A.2.5.4.3 Value Operations](#a-2-5-4-3-value-operations)
40-
- [A.2.5.4.3.1 Literal Operations](#a-2-5-4-3-1-literal-operations)
41-
- [A.2.5.4.3.2 Arithmetic and Logical Operations](#a-2-5-4-3-2-arithmetic-and-logical-operations)
42-
- [A.2.5.4.3.3 Type Conversion Operations](#a-2-5-4-3-3-type-conversion-operations)
43-
- [A.2.5.4.3.4 Special Value Operations](#a-2-5-4-3-4-special-value-operations)
44-
- [A.2.5.4.4 Location Description Operations](#a-2-5-4-4-location-description-operations)
45-
- [A.2.5.4.4.1 General Location Description Operations](#a-2-5-4-4-1-general-location-description-operations)
46-
- [A.2.5.4.4.2 Undefined Location Description Operations](#a-2-5-4-4-2-undefined-location-description-operations)
47-
- [A.2.5.4.4.3 Memory Location Description Operations](#a-2-5-4-4-3-memory-location-description-operations)
48-
- [A.2.5.4.4.4 Register Location Description Operations](#a-2-5-4-4-4-register-location-description-operations)
49-
- [A.2.5.4.4.5 Implicit Location Description Operations](#a-2-5-4-4-5-implicit-location-description-operations)
50-
- [A.2.5.4.4.6 Composite Location Description Operations](#a-2-5-4-4-6-composite-location-description-operations)
51-
- [A.2.5.5 DWARF Location List Expressions](#a-2-5-5-dwarf-location-list-expressions)
52-
- [A.3 Program Scope Entries](#a-3-program-scope-entries)
53-
- [A.3.3 Subroutine and Entry Point Entries](#a-3-3-subroutine-and-entry-point-entries)
54-
- [A.3.3.5 Low-Level Information](#a-3-3-5-low-level-information)
55-
- [A.3.4 Call Site Entries and Parameters](#a-3-4-call-site-entries-and-parameters)
56-
- [A.3.4.2 Call Site Parameters](#a-3-4-2-call-site-parameters)
57-
- [A.3.5 Lexical Block Entries](#a-3-5-lexical-block-entries)
58-
- [A.4 Data Object and Object List Entries](#a-4-data-object-and-object-list-entries)
59-
- [A.4.1 Data Object Entries](#a-4-1-data-object-entries)
60-
- [A.5 Type Entries](#a-5-type-entries)
61-
- [A.5.7 Structure, Union, Class and Interface Type Entries](#a-5-7-structure-union-class-and-interface-type-entries)
62-
- [A.5.7.3 Derived or Extended Structures, Classes and Interfaces](#a-5-7-3-derived-or-extended-structures-classes-and-interfaces)
63-
- [A.5.7.8 Member Function Entries](#a-5-7-8-member-function-entries)
64-
- [A.5.14 Pointer to Member Type Entries](#a-5-14-pointer-to-member-type-entries)
65-
- [A.5.16 Dynamic Type Entries](#a-5-16-dynamic-type-entries)
66-
- [A.6 Other Debugging Information](#a-6-other-debugging-information)
67-
- [A.6.2 Line Number Information](#a-6-2-line-number-information)
68-
- [A.6.4 Call Frame Information](#a-6-4-call-frame-information)
69-
- [A.6.4.1 Structure of Call Frame Information](#a-6-4-1-structure-of-call-frame-information)
70-
- [A.6.4.2 Call Frame Instructions](#a-6-4-2-call-frame-instructions)
71-
- [A.6.4.2.1 Row Creation Instructions](#a-6-4-2-1-row-creation-instructions)
72-
- [A.6.4.2.2 CFA Definition Instructions](#a-6-4-2-2-cfa-definition-instructions)
73-
- [A.6.4.2.3 Register Rule Instructions](#a-6-4-2-3-register-rule-instructions)
74-
- [A.6.4.2.4 Row State Instructions](#a-6-4-2-4-row-state-instructions)
75-
- [A.6.4.2.5 Padding Instruction](#a-6-4-2-5-padding-instruction)
76-
- [A.6.4.3 Call Frame Instruction Usage](#a-6-4-3-call-frame-instruction-usage)
77-
- [A.6.4.4 Call Frame Calling Address](#a-6-4-4-call-frame-calling-address)
78-
- [A.7 Data Representation](#a-7-data-representation)
79-
- [A.7.4 32-Bit and 64-Bit DWARF Formats](#a-7-4-32-bit-and-64-bit-dwarf-formats)
80-
- [A.7.5 Format of Debugging Information](#a-7-5-format-of-debugging-information)
81-
- [A.7.5.5 Classes and Forms](#a-7-5-5-classes-and-forms)
82-
- [A.7.7 DWARF Expressions](#a-7-7-dwarf-expressions)
83-
- [A.7.7.1 Operation Expressions](#a-7-7-1-operation-expressions)
84-
- [A.7.7.3 Location List Expressions](#a-7-7-3-location-list-expressions)
85-
- [B. Further Information](#b-further-information)
3+
```{contents}
4+
---
5+
local:
6+
---
7+
```
868

879
# 1. Extension
8810

@@ -111,20 +33,18 @@ specialized context sensitive operations are harder for both producers and
11133
consumers than a smaller number of general composable operations that have
11234
consistent semantics regardless of context.
11335

114-
First, section [2. Heterogeneous Computing
115-
Devices](#heterogeneous-computing-devices) describes heterogeneous devices and
116-
the features they have that are not addressed by DWARF 5. Then section [3. DWARF
117-
5](#dwarf-5) presents a brief simplified overview of the DWARF 5 expression
36+
First, section [2. Heterogeneous Computing Devices](#heterogeneous-computing-devices)
37+
describes heterogeneous devices and the features they have that are not addressed by DWARF 5.
38+
Then section [3. DWARF5](#dwarf-5) presents a brief simplified overview of the DWARF 5 expression
11839
evaluation model that highlights the difficulties for supporting the
11940
heterogeneous features. Next, section [4. Extension
12041
Solution](#extension-solution) provides an overview of the proposal, using
12142
simplified examples to illustrate how it can address the issues of heterogeneous
12243
devices and also benefit non-heterogeneous devices. Then overall conclusions are
123-
covered in section [5. Conclusion](#conclusion). Appendix [A. Changes to DWARF
124-
Debugging Information Format Version
125-
5](#a-changes-to-dwarf-debugging-information-format-version-5) gives changes
126-
relative to the DWARF Version 5 standard. Finally, appendix [B. Further
127-
Information](#b-further-information) has references to further information.
44+
covered in section [5. Conclusion](#conclusion).
45+
Appendix [A. Changes to DWARF Debugging Information Format Version 5](#changes-to-dwarf-debugging-information-format-version-5) gives changes
46+
relative to the DWARF Version 5 standard. Finally, appendix
47+
[B. Further Information](#further-information) has references to further information.
12848

12949
# 2. Heterogeneous Computing Devices
13050

@@ -625,7 +545,7 @@ Address requested for identifier "x" which is in register $rdi
625545
626546
With location descriptions on the stack, the definition of `DW_OP_use_location`
627547
can be modified by replacing every instance of "address" with "location
628-
description", as is described in [A.5 Type Entries](#a-5-type-entries).
548+
description", as is described in [Type Entries](#type-entries).
629549
630550
To implement the fully generalized version of this attribute, GCC would only
631551
need to change the expression from `DW_OP_plus` to `DW_OP_swap,
@@ -811,8 +731,7 @@ $2 = {<A> = <invalid address>, _vptr.B = <optimized out>}
811731
812732
With location descriptions on the stack, the definition of
813733
`DW_OP_data_member_location` can be modified by replacing every instance of
814-
"address" with "location description", as is described in [A.5 Type
815-
Entries](#a-5-type-entries).
734+
"address" with "location description", as is described in [A.5 Type Entries](#type-entries).
816735
817736
To implement the fully generalized version of this attribute, GCC would only
818737
need to change the last operation in the expression from `DW_OP_plus` to
@@ -1406,10 +1325,9 @@ is evaluated, it may be specified whether a value or location description is
14061325
required as the result kind.
14071326
14081327
If a result kind is specified, and the result of the evaluation does not match
1409-
the specified result kind, then the implicit conversions described in [2.5.4.4.3
1410-
Memory Location Description
1411-
Operations](#memory-location-description-operations) are performed if
1412-
valid. Otherwise, the DWARF expression is ill-formed.
1328+
the specified result kind, then the implicit conversions described in
1329+
[2.5.4.4.3 Memory Location Description Operations](#memory-location-description-operations)
1330+
are performed if valid. Otherwise, the DWARF expression is ill-formed.
14131331
14141332
If the evaluation of a DWARF expression encounters an evaluation error, then the
14151333
result is an evaluation error.
@@ -1794,9 +1712,9 @@ Operations represent a postfix operation on a simple stack machine. Each stack
17941712
entry can hold either a value or a location description. Operations can act on
17951713
entries on the stack, including adding entries and removing entries. If the kind
17961714
of a stack entry does not match the kind required by the operation and is not
1797-
implicitly convertible to the required kind (see [2.5.4.4.3 Memory Location
1798-
Description Operations](#memory-location-description-operations)), then
1799-
the DWARF operation expression is ill-formed.
1715+
implicitly convertible to the required kind
1716+
(see [2.5.4.4.3 Memory Location Description Operations](#memory-location-description-operations)),
1717+
then the DWARF operation expression is ill-formed.
18001718
18011719
Evaluation of an operation expression starts with an empty stack on which the
18021720
entries from the initial stack provided by the context are pushed in the order
@@ -1817,9 +1735,8 @@ The result of the evaluation is:
18171735
an empty operation expression for this purpose.</i>
18181736
18191737
- If the top stack entry is a location description, or can be converted to one
1820-
(see [2.5.4.4.3 Memory Location Description
1821-
Operations](#memory-location-description-operations)), then the result
1822-
is that, possibly converted, location description. Any other entries on the
1738+
(see [2.5.4.4.3 Memory Location Description Operations](#memory-location-description-operations)),
1739+
then the result is that, possibly converted, location description. Any other entries on the
18231740
stack are discarded.
18241741
- Otherwise the DWARF expression is ill-formed.
18251742
@@ -1828,9 +1745,8 @@ The result of the evaluation is:
18281745
18291746
- If the current result kind specifies a value, then:
18301747
- If the top stack entry is a value, or can be converted to one (see
1831-
[2.5.4.4.3 Memory Location Description
1832-
Operations](#memory-location-description-operations)), then the result is
1833-
that, possibly converted, value. Any other entries on the stack are
1748+
[2.5.4.4.3 Memory Location Description Operations](#memory-location-description-operations)),
1749+
then the result is that, possibly converted, value. Any other entries on the stack are
18341750
discarded.
18351751
- Otherwise the DWARF expression is ill-formed.
18361752
- If the current result kind is not specified, then:
@@ -1867,9 +1783,8 @@ stack assume that the top of the stack (most recently added entry) has index 0.
18671783
They allow the stack entries to be either a value or location description.
18681784
18691785
If any stack entry accessed by a stack operation is an incomplete composite
1870-
location description (see [2.5.4.4.6 Composite Location Description
1871-
Operations](#composite-location-description-operations)), then the DWARF
1872-
expression is ill-formed.
1786+
location description (see [2.5.4.4.6 Composite Location Description Operations]
1787+
(#composite-location-description-operations)), then the DWARF expression is ill-formed.
18731788
18741789
> NOTE: These operations now support stack entries that are values and location
18751790
> descriptions.
@@ -2346,9 +2261,8 @@ There are these special value operations currently defined:
23462261
undefined location storage or the offset of any bit exceeds the size of the
23472262
location storage LS specified by any single location description SL of L.
23482263
2349-
See [2.5.4.4.5 Implicit Location Description
2350-
Operations](#implicit-location-description-operations) for special
2351-
rules concerning implicit location descriptions created by the
2264+
See [2.5.4.4.5 Implicit Location Description Operations](#implicit-location-description-operations)
2265+
for special rules concerning implicit location descriptions created by the
23522266
`DW_OP_implicit_pointer` operation.
23532267
23542268
5. `DW_OP_xderef`
@@ -2606,8 +2520,8 @@ bit offset equal to V scaled by 8 (the byte size).
26062520
If a stack entry is required to be a location description, but it is an implicit
26072521
pointer value IPV with the target architecture default address space, then it is
26082522
implicitly converted to a location description with one single location
2609-
description specified by IPV. See [2.5.4.4.5 Implicit Location Description
2610-
Operations](#implicit-location-description-operations).
2523+
description specified by IPV. See
2524+
[2.5.4.4.5 Implicit Location Description Operations](#implicit-location-description-operations).
26112525
26122526
If a stack entry is required to be a value, but it is a location description L
26132527
with one memory location description SL in the target architecture default
@@ -3699,8 +3613,7 @@ Frame Description Entries (FDE). There is at least one CIE in every non-empty
36993613
value of length must be an integral multiple of the address size specified
37003614
in the `address_size` field.
37013615
3702-
2. `CIE_id` (4 or 8 bytes, see [7.4 32-Bit and 64-Bit DWARF
3703-
Formats](#32-bit-and-64-bit-dwarf-formats))
3616+
2. `CIE_id` (4 or 8 bytes, see [7.4 32-Bit and 64-Bit DWARF Formats](#bit-and-64-bit-dwarf-formats))
37043617
37053618
A constant that is used to distinguish CIEs from FDEs.
37063619
@@ -3796,8 +3709,7 @@ An FDE contains the following fields, in order:
37963709
of the length field plus the value of length must be an integral multiple of
37973710
the address size.
37983711
3799-
2. `CIE_pointer` (4 or 8 bytes, see [7.4 32-Bit and 64-Bit DWARF
3800-
Formats](#32-bit-and-64-bit-dwarf-formats))
3712+
2. `CIE_pointer` (4 or 8 bytes, see [7.4 32-Bit and 64-Bit DWARF Formats](#bit-and-64-bit-dwarf-formats))
38013713
38023714
A constant offset into the `.debug_frame` section that denotes the CIE that
38033715
is associated with this FDE.

llvm/docs/PointerAuth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ It returns a raw pointer value. It does **not** check that the
117117
signature is valid.
118118

119119
`key` should identify a key that is appropriate for `value`, as defined
120-
by the target-specific [keys](#key)).
120+
by the target-specific [keys](#keys)).
121121

122122
If `value` is a raw pointer value, it is returned as-is (provided the `key`
123123
is appropriate for the pointer).

llvm/docs/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# If extensions (or modules to document with autodoc) are in another directory,
1818
# add these directories to sys.path here. If the directory is relative to the
1919
# documentation root, use os.path.abspath to make it absolute, like shown here.
20-
# sys.path.insert(0, os.path.abspath('.'))
20+
sys.path.insert(0, os.path.abspath("."))
2121

2222
# -- General configuration -----------------------------------------------------
2323

@@ -28,6 +28,13 @@
2828
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
2929
extensions = ["myst_parser", "sphinx.ext.intersphinx", "sphinx.ext.todo"]
3030

31+
# Automatic anchors for markdown titles
32+
from llvm_slug import make_slug
33+
34+
myst_heading_anchors = 6
35+
myst_heading_slug_func = make_slug
36+
37+
3138
# Add any paths that contain templates here, relative to this directory.
3239
templates_path = ["_templates"]
3340

llvm/docs/llvm_slug.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# LLVM documentation anchor slug formatting
4+
5+
# Some of our markdown documentation numbers section titles
6+
# This helpers is used by myst to remove that numbering from the anchor links.
7+
8+
from docutils.nodes import make_id
9+
10+
11+
def make_slug(str):
12+
import re
13+
14+
str = re.sub(r"^\s*(\w\.)+\w\s", "", str)
15+
str = re.sub(r"^\s*\w\.\s", "", str)
16+
return make_id(str)

0 commit comments

Comments
 (0)