Commit 4c04c8e
Migrate hooks and place modules to use mostly StableMIR APIs (rust-lang#2910)
The main changes needed to make this migration besides a few method call
tweaks were:
1. Adapt `FunctionCtx` to cache information about the StableMIR version
of instance and its body.
- I also cleaned up how we were handling basic blocks which were
unnecessary.
2. Created a new ty_stable module that provide stable versions to
retrieve type information from StableMIR.
- I decided to keep these separate so it is cleaner for now. I foresee
that the type module will still rely on internal APIs for the next
little while, so separating them here made sense to me.
3. Since `Place` when retrieved from StableMIR body already comes
monomorphized, I modified the existing `codegen_place` to preemptively
monomorphize Place before converting it to a Stable version and invoking
`codegen_place_stable`.
### Call-outs
Leaving this as a draft for now since this still depends on the
following PRs to be merged into the Rust compiler:
- rust-lang#118524
- rust-lang#118516
---------
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>1 parent 2475dc6 commit 4c04c8e
File tree
15 files changed
+522
-396
lines changed- kani-compiler/src/codegen_cprover_gotoc
- codegen
- context
- overrides
- utils
15 files changed
+522
-396
lines changedLines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
142 | | - | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 176 | + | |
| 177 | + | |
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
| |||
224 | 221 | | |
225 | 222 | | |
226 | 223 | | |
227 | | - | |
| 224 | + | |
228 | 225 | | |
229 | 226 | | |
230 | 227 | | |
231 | 228 | | |
232 | 229 | | |
233 | 230 | | |
234 | 231 | | |
235 | | - | |
| 232 | + | |
| 233 | + | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | | - | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
70 | | - | |
71 | 74 | | |
72 | 75 | | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
702 | 706 | | |
703 | 707 | | |
704 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
705 | 723 | | |
706 | 724 | | |
707 | 725 | | |
| |||
735 | 753 | | |
736 | 754 | | |
737 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
738 | 762 | | |
739 | 763 | | |
740 | 764 | | |
| |||
0 commit comments