QuickBEAM.VM.Compiler.Diagnostics (QuickBEAM v0.10.9)

Copy Markdown View Source

Introspection tools for compiler mode: capability checking, helper call analysis.

Summary

Functions

Analyze a function's compilability without compiling.

Check if a function can be compiled. Returns :ok or {:error, reasons}.

Explain why a function can/cannot be compiled, with details.

Count helper calls in compiled output.

Functions

capabilities(fun)

Analyze a function's compilability without compiling.

Returns a map with:

  • :compilable? — whether the function should compile successfully
  • :unsupported_opcodes — list of %{pc: integer, opcode: atom} for unsupported ops
  • :has_var_refs — whether the function uses captured variable references
  • :opcode_count — total number of instructions

check(fun)

Check if a function can be compiled. Returns :ok or {:error, reasons}.

explain(fun)

Explain why a function can/cannot be compiled, with details.

helper_call_counts(fun)

Count helper calls in compiled output.