Skip to content

Commit 7c8aa5c

Browse files
committed
merge(printer): resolve #131 against latest master
2 parents 11180ce + 89b75f0 commit 7c8aa5c

12 files changed

Lines changed: 2052 additions & 1761 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@ retroactive best-effort summary; earlier changes were not formally tracked.
2222
- `cargo_stable_mir_json` helper binary for cargo integration ([#47])
2323
- Nix derivation for reproducible builds ([#96])
2424
- macOS support ([#97])
25+
- Mutability field on `PtrType` and `RefType` in `TypeMetadata`, needed to distinguish `PtrToPtr` casts that change mutability from those that change pointee type ([#127])
26+
- ADR-001: index-first graph architecture for MIR visualization ([#124])
2527

2628
### Changed
27-
- Restructured `printer.rs` into a declarative 3-phase pipeline: `collect_items` -> `collect_and_analyze_items` -> `assemble_smir`, with `CollectedCrate`/`DerivedInfo` interface types enforcing the boundary between collection and assembly
28-
- Added `AllocMap` with debug-mode coherence checking (`verify_coherence`): asserts that every `AllocId` in stored bodies exists in the alloc map and that no body is walked twice; zero cost in release builds
29-
- Removed dead static-item fixup from `assemble_smir` (violated the phase boundary, misclassified statics as functions; never triggered in integration tests)
30-
- Rewrote `run_ui_tests.sh`: flag-based CLI (`--verbose`, `--save-generated-output`, `--save-debug-output`), build-once-then-invoke (eliminates per-test cargo overhead), arch-aware skip logic for cross-platform test lists
31-
- UI test runners now extract and pass `//@ compile-flags:`, `//@ edition:`, and `//@ rustc-env:` directives from test files (previously silently ignored)
29+
- Restructured `printer.rs` into a declarative 3-phase pipeline: `collect_items` -> `collect_and_analyze_items` -> `assemble_smir`, with `CollectedCrate`/`DerivedInfo` interface types enforcing the boundary between collection and assembly ([#121])
30+
- Added `AllocMap` with debug-mode coherence checking (`verify_coherence`): asserts that every `AllocId` in stored bodies exists in the alloc map and that no body is walked twice; zero cost in release builds ([#121])
31+
- Removed dead static-item fixup from `assemble_smir` (violated the phase boundary, misclassified statics as functions; never triggered in integration tests) ([#121])
32+
- Rewrote `run_ui_tests.sh`: flag-based CLI (`--verbose`, `--save-generated-output`, `--save-debug-output`), build-once-then-invoke (eliminates per-test cargo overhead), arch-aware skip logic for cross-platform test lists ([#126])
33+
- UI test runners now extract and pass `//@ compile-flags:`, `//@ edition:`, and `//@ rustc-env:` directives from test files (previously silently ignored) ([#126])
3234
- Switched from compiler build to `rustup`-managed toolchain ([#33])
3335
- Removed forked rust dependency ([#19])
3436

3537
### Fixed
36-
- Fixed `get_prov_ty` to recursively walk nested struct/tuple fields when resolving provenance types; previously used exact byte-offset matching which panicked on pointers inside nested structs (e.g., `&str` at offset 56 inside `TestDesc` inside `TestDescAndFn`)
37-
- Removed incorrect `builtin_deref` assertions from VTable and Static allocation collection that rejected valid non-pointer types (raw `*const ()` vtable pointers, non-pointer statics)
38-
- Replaced panicking `unwrap`/`assert` calls in `get_prov_ty` with graceful fallbacks for layout failures, non-rigid types, and unexpected offsets
39-
- Fixed early `return` in `BodyAnalyzer::visit_terminator` that skipped `super_terminator()`, causing alloc/type/span collection to miss everything inside `Call` terminators with non-`ZeroSized` function operands (const-evaluated function pointers); bug present since [`aff2dd0`](https://github.com/runtimeverification/stable-mir-json/commit/aff2dd0)
38+
- Fixed `get_prov_ty` to recursively walk nested struct/tuple fields when resolving provenance types; previously used exact byte-offset matching which panicked on pointers inside nested structs (e.g., `&str` at offset 56 inside `TestDesc` inside `TestDescAndFn`) ([#126])
39+
- Removed incorrect `builtin_deref` assertions from VTable and Static allocation collection that rejected valid non-pointer types (raw `*const ()` vtable pointers, non-pointer statics) ([#126])
40+
- Replaced panicking `unwrap`/`assert` calls in `get_prov_ty` with graceful fallbacks for layout failures, non-rigid types, and unexpected offsets ([#126])
41+
- Fixed early `return` in `BodyAnalyzer::visit_terminator` that skipped `super_terminator()`, causing alloc/type/span collection to miss everything inside `Call` terminators with non-`ZeroSized` function operands (const-evaluated function pointers); bug present since [`aff2dd0`](https://github.com/runtimeverification/stable-mir-json/commit/aff2dd0) ([#126])
4042
- Avoided duplicate `inst.body()` calls that were reallocating `AllocId`s ([#120])
4143
- Prevented svg/png generation when `dot` is unavailable ([#117])
4244
- Removed unreachable early return in D2 legend rendering ([#118])
@@ -72,6 +74,10 @@ retroactive best-effort summary; earlier changes were not formally tracked.
7274
[#117]: https://github.com/runtimeverification/stable-mir-json/pull/117
7375
[#118]: https://github.com/runtimeverification/stable-mir-json/pull/118
7476
[#120]: https://github.com/runtimeverification/stable-mir-json/pull/120
77+
[#121]: https://github.com/runtimeverification/stable-mir-json/pull/121
78+
[#124]: https://github.com/runtimeverification/stable-mir-json/pull/124
79+
[#126]: https://github.com/runtimeverification/stable-mir-json/pull/126
80+
[#127]: https://github.com/runtimeverification/stable-mir-json/pull/127
7581

7682
## [0.1.0] - 2024-11-29
7783

src/mk_graph/index.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub enum TypeKind {
7575
pointee: Ty,
7676
mutability: stable_mir::mir::Mutability,
7777
},
78+
Dyn,
7879
Function,
7980
Void,
8081
}
@@ -409,6 +410,10 @@ impl TypeEntry {
409410
layout_info,
410411
)
411412
}
413+
TypeMetadata::DynType { name, layout } => {
414+
let layout_info = layout.as_ref().map(LayoutInfo::from_shape);
415+
(name.clone(), TypeKind::Dyn, layout_info)
416+
}
412417
TypeMetadata::FunType(name) => (name.clone(), TypeKind::Function, None),
413418
TypeMetadata::VoidType => ("()".to_string(), TypeKind::Void, None),
414419
};

0 commit comments

Comments
 (0)