Skip to content

Commit 7cd0324

Browse files
authored
Consistently apply code formatting to paths and file names (#21500)
Consistently apply code formatting to paths and file names and correct the Julia/C comparison example's indexing
1 parent 8be245b commit 7cd0324

18 files changed

+125
-124
lines changed

doc/src/devdocs/backtraces.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ to figure out why your script is running slower than expected.
88
If you've been directed to this page, find the symptom that best matches what you're experiencing
99
and follow the instructions to generate the debugging information requested. Table of symptoms:
1010

11-
* [Segfaults during bootstrap (sysimg.jl)](@ref)
11+
* [Segfaults during bootstrap (`sysimg.jl`)](@ref)
1212
* [Segfaults when running a script](@ref)
1313
* [Errors during Julia startup](@ref)
1414

@@ -32,7 +32,7 @@ Platform Info:
3232
LLVM: libLLVM-3.3
3333
```
3434

35-
## Segfaults during bootstrap (sysimg.jl)
35+
## Segfaults during bootstrap (`sysimg.jl`)
3636

3737
Segfaults toward the end of the `make` process of building Julia are a common symptom of something
3838
going wrong while Julia is preparsing the corpus of code in the `base/` folder. Many factors
@@ -64,7 +64,7 @@ on Github with a link to the gist.
6464

6565
## Segfaults when running a script
6666

67-
The procedure is very similar to [Segfaults during bootstrap (sysimg.jl)](@ref). Create a debug
67+
The procedure is very similar to [Segfaults during bootstrap (`sysimg.jl`)](@ref). Create a debug
6868
build of Julia, and run your script inside of a debugged Julia process:
6969

7070
```

doc/src/devdocs/debuggingtips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Julia's flisp interpreter uses `value_t` objects; these can be displayed with `c
2626
## Useful Julia variables for Inspecting
2727

2828
While the addresses of many variables, like singletons, can be be useful to print for many failures,
29-
there are a number of additional variables (see julia.h for a complete list) that are even more
29+
there are a number of additional variables (see `julia.h` for a complete list) that are even more
3030
useful.
3131

3232
* (when in `jl_apply_generic`) `mfunc` and `jl_uncompress_ast(mfunc->def, mfunc->code)` :: for

doc/src/devdocs/eval.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The 10,000 foot view of the whole process is as follows:
2525
1. The user starts `julia`.
2626
2. The C function `main()` from `ui/repl.c` gets called. This function processes the command line
2727
arguments, filling in the `jl_options` struct and setting the variable `ARGS`. It then initializes
28-
Julia (by calling [`julia_init` in task.c](https://github.com/JuliaLang/julia/blob/master/src/task.c),
28+
Julia (by calling [`julia_init` in `task.c`](https://github.com/JuliaLang/julia/blob/master/src/task.c),
2929
which may load a previously compiled [sysimg](@ref dev-sysimg)). Finally, it passes off control to Julia
3030
by calling [`Base._start()`](https://github.com/JuliaLang/julia/blob/master/base/client.jl).
3131
3. When `_start()` takes over control, the subsequent sequence of commands depends on the command
@@ -45,7 +45,7 @@ The 10,000 foot view of the whole process is as follows:
4545
the AST to make it simpler to execute.
4646
10. `jl_toplevel_eval_flex()` then uses some simple heuristics to decide whether to JIT compiler the
4747
AST or to interpret it directly.
48-
11. The bulk of the work to interpret code is handled by [`eval` in interpreter.c](https://github.com/JuliaLang/julia/blob/master/src/interpreter.c).
48+
11. The bulk of the work to interpret code is handled by [`eval` in `interpreter.c`](https://github.com/JuliaLang/julia/blob/master/src/interpreter.c).
4949
12. If instead, the code is compiled, the bulk of the work is handled by `codegen.cpp`. Whenever a
5050
Julia function is called for the first time with a given set of argument types, [type inference](@ref dev-type-inference)
5151
will be run on that function. This information is used by the [codegen](@ref dev-codegen) step to generate
@@ -62,12 +62,12 @@ The 10,000 foot view of the whole process is as follows:
6262
The Julia parser is a small lisp program written in femtolisp, the source-code for which is distributed
6363
inside Julia in [src/flisp](https://github.com/JuliaLang/julia/tree/master/src/flisp).
6464

65-
The interface functions for this are primarily defined in [jlfrontend.scm](https://github.com/JuliaLang/julia/blob/master/src/jlfrontend.scm).
66-
The code in [ast.c](https://github.com/JuliaLang/julia/blob/master/src/ast.c) handles this handoff
65+
The interface functions for this are primarily defined in [`jlfrontend.scm`](https://github.com/JuliaLang/julia/blob/master/src/jlfrontend.scm).
66+
The code in [`ast.c`](https://github.com/JuliaLang/julia/blob/master/src/ast.c) handles this handoff
6767
on the Julia side.
6868

69-
The other relevant files at this stage are [julia-parser.scm](https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm),
70-
which handles tokenizing Julia code and turning it into an AST, and [julia-syntax.scm](https://github.com/JuliaLang/julia/blob/master/src/julia-syntax.scm),
69+
The other relevant files at this stage are [`julia-parser.scm`](https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm),
70+
which handles tokenizing Julia code and turning it into an AST, and [`julia-syntax.scm`](https://github.com/JuliaLang/julia/blob/master/src/julia-syntax.scm),
7171
which handles transforming complex AST representations into simpler, "lowered" AST representations
7272
which are more suitable for analysis and execution.
7373

@@ -83,7 +83,7 @@ although it can also be invoked directly by a call to [`macroexpand()`](@ref)/`j
8383

8484
## [Type Inference](@id dev-type-inference)
8585

86-
Type inference is implemented in Julia by [typeinf() in inference.jl](https://github.com/JuliaLang/julia/blob/master/base/inference.jl).
86+
Type inference is implemented in Julia by [`typeinf()` in `inference.jl`](https://github.com/JuliaLang/julia/blob/master/base/inference.jl).
8787
Type inference is the process of examining a Julia function and determining bounds for the types
8888
of each of its variables, as well as bounds on the type of the return value from the function.
8989
This enables many future optimizations, such as unboxing of known immutable values, and compile-time
@@ -135,26 +135,26 @@ Type inference may also include other steps such as constant propagation and inl
135135

136136
Codegen is the process of turning a Julia AST into native machine code.
137137

138-
The JIT environment is initialized by an early call to [`jl_init_codegen` in codegen.cpp](https://github.com/JuliaLang/julia/blob/master/src/codegen.cpp).
138+
The JIT environment is initialized by an early call to [`jl_init_codegen` in `codegen.cpp`](https://github.com/JuliaLang/julia/blob/master/src/codegen.cpp).
139139

140140
On demand, a Julia method is converted into a native function by the function `emit_function(jl_method_instance_t*)`.
141141
(note, when using the MCJIT (in LLVM v3.4+), each function must be JIT into a new module.) This
142142
function recursively calls `emit_expr()` until the entire function has been emitted.
143143

144144
Much of the remaining bulk of this file is devoted to various manual optimizations of specific
145145
code patterns. For example, `emit_known_call()` knows how to inline many of the primitive functions
146-
(defined in [builtins.c](https://github.com/JuliaLang/julia/blob/master/src/builtins.c)) for various
146+
(defined in [`builtins.c`](https://github.com/JuliaLang/julia/blob/master/src/builtins.c)) for various
147147
combinations of argument types.
148148

149149
Other parts of codegen are handled by various helper files:
150150

151-
* [debuginfo.cpp](https://github.com/JuliaLang/julia/blob/master/src/debuginfo.cpp)
151+
* [`debuginfo.cpp`](https://github.com/JuliaLang/julia/blob/master/src/debuginfo.cpp)
152152

153153
Handles backtraces for JIT functions
154-
* [ccall.cpp](https://github.com/JuliaLang/julia/blob/master/src/ccall.cpp)
154+
* [`ccall.cpp`](https://github.com/JuliaLang/julia/blob/master/src/ccall.cpp)
155155

156156
Handles the ccall and llvmcall FFI, along with various `abi_*.cpp` files
157-
* [intrinsics.cpp](https://github.com/JuliaLang/julia/blob/master/src/intrinsics.cpp)
157+
* [`intrinsics.cpp`](https://github.com/JuliaLang/julia/blob/master/src/intrinsics.cpp)
158158

159159
Handles the emission of various low-level intrinsic functions
160160

@@ -168,11 +168,11 @@ Other parts of codegen are handled by various helper files:
168168
## [System Image](@id dev-sysimg)
169169

170170
The system image is a precompiled archive of a set of Julia files. The `sys.ji` file distributed
171-
with Julia is one such system image, generated by executing the file [sysimg.jl](https://github.com/JuliaLang/julia/blob/master/base/sysimg.jl),
171+
with Julia is one such system image, generated by executing the file [`sysimg.jl`](https://github.com/JuliaLang/julia/blob/master/base/sysimg.jl),
172172
and serializing the resulting environment (including Types, Functions, Modules, and all other
173173
defined values) into a file. Therefore, it contains a frozen version of the `Main`, `Core`, and
174174
`Base` modules (and whatever else was in the environment at the end of bootstrapping). This serializer/deserializer
175-
is implemented by [`jl_save_system_image`/`jl_restore_system_image` in dump.c](https://github.com/JuliaLang/julia/blob/master/src/dump.c).
175+
is implemented by [`jl_save_system_image`/`jl_restore_system_image` in `dump.c`](https://github.com/JuliaLang/julia/blob/master/src/dump.c).
176176

177177
If there is no sysimg file (`jl_options.image_file == NULL`), this also implies that `--build`
178178
was given on the command line, so the final result should be a new sysimg file. During Julia initialization,

doc/src/devdocs/functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ some number of handlers (currently 25). Presumably no performance-critical funct
261261
more than 25 exception handlers. If one ever does, I'm willing to raise the limit to 26.
262262
263263
A minor issue occurs during the bootstrap process due to storing all constructors in a single
264-
method table. In the second bootstrap step, where inference.ji is compiled using inference0.ji,
265-
constructors for inference0's types remain in the table, so there are still references to the
266-
old inference module and inference.ji is 2x the size it should be. This was fixed in dump.c by
264+
method table. In the second bootstrap step, where `inference.ji` is compiled using `inference0.ji`,
265+
constructors for `inference0`'s types remain in the table, so there are still references to the
266+
old inference module and `inference.ji` is 2x the size it should be. This was fixed in `dump.c` by
267267
filtering definitions from "replaced modules" out of method tables and caches before saving a
268268
system image. A "replaced module" is one that satisfies the condition `m != jl_get_global(m->parent, m->name)`
269269
-- in other words, some newer module has taken its name and place.

0 commit comments

Comments
 (0)