Expand description
Thread-local identity of the currently-running analysis pass.
The pipeline driver brackets every pass invocation in a PassScope guard.
While the guard is alive, current_pass names the pass, so the
assumption API (Context::assume_true
and friends), the pass_log! macro, and the
stat! counters attribute their records to the right pass
without any plumbing through call signatures — free helper functions get
the attribution too.
Outside any scope, current_pass reports "?" so stray records remain
visible (and greppable) rather than silently unattributed.
Structs§
- Pass
Scope - RAII guard naming the current pass; restores the previous name on drop, so scopes nest (a driver phase can wrap individual passes).
Constants§
- UNATTRIBUTED
- The name reported outside any
PassScope.
Functions§
- absorb_
stats - Fold
entries(as produced bydrain_stats) back into this thread’s counters. The parallel function-pass driver drains each worker thread’s counters before the thread exits (thread-local state would otherwise be lost) and re-absorbs them on the master thread, so the per-round statistics table is identical to a sequential run. - current_
pass - The name of the pass currently running on this thread (or
UNATTRIBUTED). - drain_
stats - Drain all counters accumulated on this thread since the last drain, as
((pass, key), total)in sorted order. The pipeline driver calls this once per round to log a statistics table. - enter
- Enter a pass scope. Hold the returned guard for the duration of the pass.
- record_
stat - Add
nto the counterkeyof the current pass. Prefer thestat!macro.