Class CoverageProbeInstr

java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.CoverageProbeInstr
All Implemented Interfaces:
INode

public final class CoverageProbeInstr extends IRInstr
Specialized IR instruction for coverage probe recording (COVERAGE_PROBE).

Coverage probes are inserted at control flow points during IR generation when coverage is enabled. Each probe records that a specific code path was executed.

The instruction carries full probe details for metadata generation and uses operands for human-readable IR output.

  • Method Details

    • probe

      public static CoverageProbeInstr probe(long moduleId, CoverageProbeDetails probeDetails, DebugInfo debugInfo)
      Create a coverage probe instruction.
      Parameters:
      moduleId - The module ID containing this probe
      probeDetails - Full probe details for metadata and reporting
      debugInfo - Optional source location debug info
    • probe

      public static CoverageProbeInstr probe(long moduleId, int probeId, CoverageProbeType type, DebugInfo debugInfo)
      Create a simple coverage probe instruction with minimal details.
      Parameters:
      moduleId - The module ID containing this probe
      probeId - The unique probe ID within the module
      type - The type of control flow point
      debugInfo - Optional source location debug info
    • getProbeDetails

      public CoverageProbeDetails getProbeDetails()
      Get the full probe details for this instruction.
    • getProbeId

      public int getProbeId()
      Get the probe ID.
    • getProbeType

      public CoverageProbeType getProbeType()
      Get the probe type.
    • isFunctionEntry

      public boolean isFunctionEntry()
      Check if this is a function entry probe.
    • isBranchProbe

      public boolean isBranchProbe()
      Check if this is a branch probe (true or false).
    • accept

      public void accept(INodeVisitor visitor)
      Specified by:
      accept in interface INode
      Overrides:
      accept in class IRInstr
    • toString

      public String toString()
      Overrides:
      toString in class IRInstr