Skip to content

Commit 65ff590

Browse files
committed
ssa: verify; v2.gen: mini asm for more readability
1 parent 83d8f86 commit 65ff590

8 files changed

Lines changed: 2199 additions & 450 deletions

File tree

‎vlib/v2/builder/builder.v‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ fn (mut b Builder) gen_ssa_c() {
121121
// Build all files together with proper multi-file ordering
122122
ssa_builder.build_all(transformed_files)
123123
optimize.optimize(mut mod)
124+
$if debug {
125+
optimize.verify_and_panic(mod, 'full optimization')
126+
}
124127

125128
mut gen := c.Gen.new(mod)
126129
c_source := gen.gen()
@@ -169,6 +172,9 @@ fn (mut b Builder) gen_native(backend_arch pref.Arch) {
169172
// Build all files together with proper multi-file ordering
170173
ssa_builder.build_all(transformed_files)
171174
optimize.optimize(mut mod)
175+
$if debug {
176+
optimize.verify_and_panic(mod, 'full optimization')
177+
}
172178

173179
// Determine output binary name from the last user file
174180
output_binary := if b.pref.output_file != '' {

0 commit comments

Comments
 (0)