Skip to content

Commit

Permalink
checker,cgen: move the `msvc compiler does not support inline assembl…
Browse files Browse the repository at this point in the history
…y` to cgen (so it will only get triggered, when ASM blocks are still present, in what is passed to cgen)
  • Loading branch information
spytheman committed Nov 21, 2024
1 parent 81129d1 commit 27b728b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -2420,9 +2420,6 @@ fn (mut c Checker) asm_stmt(mut stmt ast.AsmStmt) {
if c.pref.backend.is_js() {
c.error('inline assembly is not supported in the js backend', stmt.pos)
}
if c.pref.backend == .c && c.pref.ccompiler_type == .msvc {
c.error('msvc compiler does not support inline assembly', stmt.pos)
}
mut aliases := c.asm_ios(mut stmt.output, mut stmt.scope, true)
aliases2 := c.asm_ios(mut stmt.input, mut stmt.scope, false)
aliases << aliases2
Expand Down
3 changes: 3 additions & 0 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,9 @@ fn (mut g Gen) stmt(node ast.Stmt) {
g.writeln('goto ${c_name(node.name)};')
}
ast.AsmStmt {
if g.is_cc_msvc {
g.error('msvc does not support inline assembly', node.pos)
}
g.write_v_source_line_info_stmt(node)
g.asm_stmt(node)
}
Expand Down

0 comments on commit 27b728b

Please sign in to comment.