Skip to content

Commit a13635b

Browse files
committed
docs/bgen.md: clean up
1 parent 363f47e commit a13635b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/bgen.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ The architecture of the B compiler attempts to loosely decouple the front end (t
44

55
When it comes to the back end there are two main terms to consider:
66
1. **Target** is whatever you select using the `-t` flag of both `b` and `btest` programs. To get the list of all available targets use flag `-tlist` on any of them.
7-
2. **Codegen** is a collection of Targets implemented as a submodule of the `codegen` module. All codegens are located in the `<root>/src/codegen/` folder.
7+
2. **Codegen** is a collection of Targets implemented as a submodule of the `codegen` module. All codegens are located in the [`<root>/src/codegen/`](../src/codegen) folder.
88

9-
The reason it is organized like that is because some targets share a lot of code with each other. Especially when they are implemented for the same CPU architecture. For example targets `gas-x86_64-linux`, `gas-x86_64-windows`, and `gas-x86_64-darwin` are part of a single codegen `gas_x86_64` and differ only in how they pass arguments to function calls according their platform ABIs.
9+
The reason it is organized like that is because some targets share a lot of code with each other. Especially when they are implemented for the same CPU architecture. For example targets `gas-x86_64-linux`, `gas-x86_64-windows`, and `gas-x86_64-darwin` are part of a single codegen [gas_x86_64](../src/codegen/gas_x86_64) and differ only in how they pass arguments to function calls according their platform ABIs.
1010

11-
Any valid Rust module under `<root>/src/codegen/` folder is automatically picked up by the build system and plugged as an additional codegen. For an example of a "pluggable" codegen see [https://github.com/bext-lang/dotnet_mono](https://github.com/bext-lang/dotnet_mono). The way you plug it in is
11+
Any valid Rust module under [`<root>/src/codegen/](../src/codegen/)` folder is automatically picked up by the build system and plugged as an additional codegen. For an example of a "pluggable" codegen see [https://github.com/bext-lang/dotnet_mono](https://github.com/bext-lang/dotnet_mono). The way you plug it in is
1212

1313
```console
1414
$ git clone https://github.com/bext-lang/b
@@ -19,13 +19,13 @@ $ make
1919
$ ./build/b -t ilasm-mono ./examples/hello_world.b -run
2020
```
2121

22-
For an example of a minimal pluggable codegen see `<root>/src/codegen/noop.rs`.
22+
For an example of a minimal pluggable codegen see [`<root>/src/codegen/noop.rs`](../src/codegen/noop.rs).
2323

2424
## The Pluggable Codegen Format™
2525

26-
A pluggable codegen is a usually a valid [git repo](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository) and a valid [Rust module](https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html) simultaneously. This is what enables just `git clone`-ing it into `<root>/src/codegen`.
26+
A pluggable codegen is usually a valid [git repo](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository) and a valid [Rust module](https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html) simultaneously. This is what enables just `git clone`-ing it into [`<root>/src/codegen`](../src/codegen/).
2727

28-
On top of being a Rust module the Codegen is allowed to have additional special folders and files.
28+
On top of being a Rust module the Codegen is allowed to have additional special folders and files:
2929

30-
- `<codegen_root>/libb/*` - a collection of libb implementation for all the targets codegen provides. All such folders for all codegens are automatically detected by the build system and aggregated into `<root>/build/libb/*` so all of them are available to the B compiler.
30+
- `<codegen_root>/libb/*` - a collection of libb implementations for all the targets codegen provides. All such folders for all codegens are automatically detected by the build system and aggregated into `<root>/build/libb/*` so all of them are available to the `<root>/build/b` compiler.
3131
- *To be continued...*

0 commit comments

Comments
 (0)