align code blocks with their paragraphs

This commit is contained in:
Tshepang Mbambo 2022-11-04 03:40:37 +02:00
parent 100e801b36
commit f51a573c19
1 changed files with 23 additions and 21 deletions

View File

@ -10,12 +10,13 @@ through all of the compiler layers down to LLVM codegen. Throughout the various
- The template string, which is stored as an array of `InlineAsmTemplatePiece`. Each piece - The template string, which is stored as an array of `InlineAsmTemplatePiece`. Each piece
represents either a literal or a placeholder for an operand (just like format strings). represents either a literal or a placeholder for an operand (just like format strings).
```rust
pub enum InlineAsmTemplatePiece { ```rust
String(String), pub enum InlineAsmTemplatePiece {
Placeholder { operand_idx: usize, modifier: Option<char>, span: Span }, String(String),
} Placeholder { operand_idx: usize, modifier: Option<char>, span: Span },
``` }
```
- The list of operands to the `asm!` (`in`, `[late]out`, `in[late]out`, `sym`, `const`). These are - The list of operands to the `asm!` (`in`, `[late]out`, `in[late]out`, `sym`, `const`). These are
represented differently at each stage of lowering, but follow a common pattern: represented differently at each stage of lowering, but follow a common pattern:
@ -34,21 +35,22 @@ or a `fn`.
- The options set at the end of the `asm!` macro. The only ones that are of particular interest to - The options set at the end of the `asm!` macro. The only ones that are of particular interest to
rustc are `NORETURN` which makes `asm!` return `!` instead of `()`, and `RAW` which disables format rustc are `NORETURN` which makes `asm!` return `!` instead of `()`, and `RAW` which disables format
string parsing. The remaining options are mostly passed through to LLVM with little processing. string parsing. The remaining options are mostly passed through to LLVM with little processing.
```rust
bitflags::bitflags! { ```rust
pub struct InlineAsmOptions: u16 { bitflags::bitflags! {
const PURE = 1 << 0; pub struct InlineAsmOptions: u16 {
const NOMEM = 1 << 1; const PURE = 1 << 0;
const READONLY = 1 << 2; const NOMEM = 1 << 1;
const PRESERVES_FLAGS = 1 << 3; const READONLY = 1 << 2;
const NORETURN = 1 << 4; const PRESERVES_FLAGS = 1 << 3;
const NOSTACK = 1 << 5; const NORETURN = 1 << 4;
const ATT_SYNTAX = 1 << 6; const NOSTACK = 1 << 5;
const RAW = 1 << 7; const ATT_SYNTAX = 1 << 6;
const MAY_UNWIND = 1 << 8; const RAW = 1 << 7;
} const MAY_UNWIND = 1 << 8;
} }
``` }
```
## AST ## AST