Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e33a3f9

Browse files
committed
Update unstable-book with recent asm changes (may_unwind)
1 parent 6cbf44f commit e33a3f9

File tree

1 file changed

+2
-1
lines changed
  • src/doc/unstable-book/src/library-features

1 file changed

+2
-1
lines changed

src/doc/unstable-book/src/library-features/asm.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ operand_expr := expr / "_" / expr "=>" expr / expr "=>" "_"
454454
reg_operand := dir_spec "(" reg_spec ")" operand_expr
455455
operand := reg_operand / "const" const_expr / "sym" path
456456
clobber_abi := "clobber_abi(" <abi> *["," <abi>] [","] ")"
457-
option := "pure" / "nomem" / "readonly" / "preserves_flags" / "noreturn" / "nostack" / "att_syntax" / "raw"
457+
option := "pure" / "nomem" / "readonly" / "preserves_flags" / "noreturn" / "nostack" / "att_syntax" / "raw" / "may_unwind"
458458
options := "options(" option *["," option] [","] ")"
459459
asm := "asm!(" format_string *("," format_string) *("," [ident "="] operand) *("," clobber_abi) *("," options) [","] ")"
460460
```
@@ -829,6 +829,7 @@ Currently the following options are defined:
829829
- `noreturn`: The `asm` block never returns, and its return type is defined as `!` (never). Behavior is undefined if execution falls through past the end of the asm code. A `noreturn` asm block behaves just like a function which doesn't return; notably, local variables in scope are not dropped before it is invoked.
830830
- `nostack`: The `asm` block does not push data to the stack, or write to the stack red-zone (if supported by the target). If this option is *not* used then the stack pointer is guaranteed to be suitably aligned (according to the target ABI) for a function call.
831831
- `att_syntax`: This option is only valid on x86, and causes the assembler to use the `.att_syntax prefix` mode of the GNU assembler. Register operands are substituted in with a leading `%`.
832+
- `may_unwind`: The `asm` block may unwind the stack and be part of the stack unwinding process (This option is only supported by the LLVM backend right now).
832833
- `raw`: This causes the template string to be parsed as a raw assembly string, with no special handling for `{` and `}`. This is primarily useful when including raw assembly code from an external file using `include_str!`.
833834

834835
The compiler performs some additional checks on options:

0 commit comments

Comments
 (0)