LibJS: Stop worrying about Instruction destructors

By adding static_asserts to prove that all of our generated instruction
classes are trivially destructible, we can confidently remove the
destructor walk in BasicBlock and save ourselves some unnecessary work.
This commit is contained in:
Andreas Kling 2025-11-21 08:26:37 +01:00 committed by Andreas Kling
parent 370b81f1b7
commit f37063e2a1
Notes: github-actions[bot] 2025-11-21 08:47:34 +00:00
4 changed files with 2 additions and 27 deletions

View file

@ -322,6 +322,7 @@ def generate_class(op: OpDef) -> str:
lines.append(f" {f.type} {f.name};")
lines.append("};")
lines.append(f"static_assert(IsTriviallyDestructible<{op.name}>);")
return "\n".join(lines)