RemoveTraces

scalus.compiler.sir.RemoveTraces
object RemoveTraces

Removes fully-applied Trace builtin calls from SIR, replacing them with their value argument.

This is used for release builds to strip log() calls and their message computations (string concatenation, show calls, etc.) from the script, reducing size and execution cost.

The transformation also cleans up dead let bindings that become trivial () after trace removal (the common pattern from log("msg")let _ = trace(msg)(()) in bodylet _ = () in bodybody).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def transform(sir: SIR): SIR

Transforms a SIR tree by removing all fully-applied Trace calls.

Transforms a SIR tree by removing all fully-applied Trace calls.

Value parameters

sir

the SIR tree to transform

Attributes

Returns

the transformed SIR with trace calls removed