about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-09 20:30:20 +0000
committerbors <bors@rust-lang.org>2023-07-09 20:30:20 +0000
commit5f11c9a1c3c213405f99c2bd369b679c08615554 (patch)
tree39e39c7640257e90c651c41d06f6bc16702d093c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentdcda13ac6994515a9aa7811a0e8088f61899a44a (diff)
parentd0df00d2742e6a3e6b499e403926bde09ca19f0f (diff)
downloadrust-5f11c9a1c3c213405f99c2bd369b679c08615554.tar.gz
rust-5f11c9a1c3c213405f99c2bd369b679c08615554.zip
Auto merge of #15081 - adenine-dev:master, r=HKalbasi
Feature: Add a memory layout viewer

**Motivation**: rustc by default doesn't enforce a particular memory layout, however it can be useful to see what it is doing under the hood, or if using a particular repr ensure it is behaving how you want it to. This command provides a way to visually explore memory layouts of structures.

**Example**:
this structure:
```rust
struct X {
    x: i32,
    y: u8,
    z: Vec<bool>,
    w: usize,
}
```
produces this output:
<img width="692" alt="image" src="https://github.com/rust-lang/rust-analyzer/assets/22418744/e0312233-18a7-4bb9-ae5b-7b52fcff158a">

**Work yet to be done**:
- tests (see below)
- html is mildly janky (see below)
- enums and unions are viewed flatly, how should they be represented?
- should niches be marked somehow?

This was written for my own use, and the jank is fine for me, but in its current state it is probably not ready to merge mostly because it is missing tests, and also because the code quality is not great. However, before I spend time fixing those things idk if this is even something wanted, if it is I am happy to clean it up, if not that's cool too.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions