Skip to content

asm: Defer checking template bodies and fix target feature checks - #7955

Merged
gingerBill merged 7 commits into
masterfrom
bill/asm-compiler-improvements
Oct 16, 2026
Merged

gingerBill merged 7 commits into
masterfrom
bill/asm-compiler-improvements

Conversation

@gingerBill

Copy link
Copy Markdown
Member

Like with a procedure literal, an asm template now has only its signature checked when it is declared or used.

Its specification block and body are checked later: right after the procedure body it is within, otherwise with the procedure bodies.

  • The global dependency graph only walks a template's signature.
  • Constants in a body resolve like any identifier, so ones declared later in the block or in a #+lazy file now work.
  • A body can name a constant that depends on its own template's signature (e.g. K :: size_of(f(0))).
  • A template's @(enable_target_feature) now counts in its body checks. Its callers must enable the same features, as it is inlined, which turns LLVM errors into checker errors.
  • On unsupported targets, the signature is checked before the "not supported" error.

@gingerBill
gingerBill merged commit 0444fb2 into master Oct 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant