Skip to content

Commit dc240fa

Browse files
committed
Cleanup LLVM debuginfo module docs
* Use Markdown list syntax and unindent a bit to prevent Markdown interpreting the nested lists as code blocks * A few more small typographical cleanups
1 parent a2e9374 commit dc240fa

File tree

1 file changed

+15
-14
lines changed
  • compiler/rustc_codegen_llvm/src/debuginfo

1 file changed

+15
-14
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/doc.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ allow to map machine code locations back to source code locations in order
9696
to be useful. This functionality is also handled in this module. The
9797
following functions allow to control source mappings:
9898

99-
+ set_source_location()
100-
+ clear_source_location()
101-
+ start_emitting_source_locations()
99+
+ `set_source_location()`
100+
+ `clear_source_location()`
101+
+ `start_emitting_source_locations()`
102102

103103
`set_source_location()` allows to set the current source location. All IR
104104
instructions created after a call to this function will be linked to the
@@ -142,21 +142,22 @@ type identifier that tells it across compilation units which types are the
142142
same as others. This type identifier is created by
143143
`TypeMap::get_unique_type_id_of_type()` using the following algorithm:
144144

145-
(1) Primitive types have their name as ID
146-
(2) Structs, enums and traits have a multipart identifier
145+
1. Primitive types have their name as ID
147146

148-
(1) The first part is the SVH (strict version hash) of the crate they
149-
were originally defined in
147+
2. Structs, enums and traits have a multipart identifier
150148

151-
(2) The second part is the ast::NodeId of the definition in their
152-
original crate
149+
1. The first part is the SVH (strict version hash) of the crate they
150+
were originally defined in
153151

154-
(3) The final part is a concatenation of the type IDs of their concrete
155-
type arguments if they are generic types.
152+
2. The second part is the ast::NodeId of the definition in their
153+
original crate
156154

157-
(3) Tuple-, pointer and function types are structurally identified, which
158-
means that they are equivalent if their component types are equivalent
159-
(i.e., (i32, i32) is the same regardless in which crate it is used).
155+
3. The final part is a concatenation of the type IDs of their concrete
156+
type arguments if they are generic types.
157+
158+
3. Tuple-, pointer-, and function types are structurally identified, which
159+
means that they are equivalent if their component types are equivalent
160+
(i.e., `(i32, i32)` is the same regardless in which crate it is used).
160161

161162
This algorithm also provides a stable ID for types that are defined in one
162163
crate but instantiated from metadata within another crate. We just have to

0 commit comments

Comments
 (0)