about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-07-04 05:11:57 +0000
committerbors <bors@rust-lang.org>2024-07-04 05:11:57 +0000
commit4a4a81aec43d87abc962cb288af104531086afe8 (patch)
treed3be0ce1b9ff8dada8e736c6921bb9b5c134dffd /src/doc
parentb0d791d3cf13a7b61b3db49591b432d88af2aec8 (diff)
parentd24bfd48b25a3aced787a774c9d679956f164cc6 (diff)
downloadrust-4a4a81aec43d87abc962cb288af104531086afe8.tar.gz
rust-4a4a81aec43d87abc962cb288af104531086afe8.zip
Auto merge of #3731 - rust-lang:rustup-2024-07-04, r=saethlin
Automatic Rustup
Diffstat (limited to 'src/doc')
m---------src/doc/book0
m---------src/doc/edition-guide0
m---------src/doc/reference0
m---------src/doc/rust-by-example0
m---------src/doc/rustc-dev-guide0
-rw-r--r--src/doc/unstable-book/src/compiler-flags/verbose-asm.md70
6 files changed, 70 insertions, 0 deletions
diff --git a/src/doc/book b/src/doc/book
-Subproject 45c1a6d69edfd1fc91fb7504cb73958dbd09441
+Subproject f1e49bf7a8ea6c31ce016a52b8a4f6e1ffcfbc6
diff --git a/src/doc/edition-guide b/src/doc/edition-guide
-Subproject cb58c430b4e8054c2cb81d2d4434092c482a93d
+Subproject 941db8b3df45fd46cd87b50a5c86714b91dcde9
diff --git a/src/doc/reference b/src/doc/reference
-Subproject 0b805c65804019b0ac8f2fe3117afad82a6069b
+Subproject 1ae3deebc3ac16e276b6558e01420f8e605def0
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
-Subproject b1d97bd6113aba732b2091ce093c76f2d05bb8a
+Subproject 658c6c27cb975b92227936024816986c2d3716f
diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide
-Subproject aec82168dd3121289a194b381f56076fc789a4d
+Subproject d6e3a32a557db5902e714604def8015d6bb7e0f
diff --git a/src/doc/unstable-book/src/compiler-flags/verbose-asm.md b/src/doc/unstable-book/src/compiler-flags/verbose-asm.md
new file mode 100644
index 00000000000..84eb90a14cf
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/verbose-asm.md
@@ -0,0 +1,70 @@
+# `verbose-asm`
+
+The tracking issue for this feature is: [#126802](https://github.com/rust-lang/rust/issues/126802).
+
+------------------------
+
+This enables passing `-Zverbose-asm` to get contextual comments added by LLVM.
+
+Sample code:
+
+```rust
+#[no_mangle]
+pub fn foo(a: i32, b: i32) -> i32 {
+    a + b
+}
+```
+
+Default output:
+
+```asm
+foo:
+        push    rax
+        add     edi, esi
+        mov     dword ptr [rsp + 4], edi
+        seto    al
+        jo      .LBB0_2
+        mov     eax, dword ptr [rsp + 4]
+        pop     rcx
+        ret
+.LBB0_2:
+        lea     rdi, [rip + .L__unnamed_1]
+        mov     rax, qword ptr [rip + core::panicking::panic_const::panic_const_add_overflow::h9c85248fe0d735b2@GOTPCREL]
+        call    rax
+
+.L__unnamed_2:
+        .ascii  "/app/example.rs"
+
+.L__unnamed_1:
+        .quad   .L__unnamed_2
+        .asciz  "\017\000\000\000\000\000\000\000\004\000\000\000\005\000\000"
+```
+
+With `-Zverbose-asm`:
+
+```asm
+foo:                                    # @foo
+# %bb.0:
+        push    rax
+        add     edi, esi
+        mov     dword ptr [rsp + 4], edi        # 4-byte Spill
+        seto    al
+        jo      .LBB0_2
+# %bb.1:
+        mov     eax, dword ptr [rsp + 4]        # 4-byte Reload
+        pop     rcx
+        ret
+.LBB0_2:
+        lea     rdi, [rip + .L__unnamed_1]
+        mov     rax, qword ptr [rip + core::panicking::panic_const::panic_const_add_overflow::h9c85248fe0d735b2@GOTPCREL]
+        call    rax
+                                        # -- End function
+.L__unnamed_2:
+        .ascii  "/app/example.rs"
+
+.L__unnamed_1:
+        .quad   .L__unnamed_2
+        .asciz  "\017\000\000\000\000\000\000\000\004\000\000\000\005\000\000"
+
+                                        # DW_AT_external
+```