summarizeByFunction

Collapses instruction-level nodes into one node per owning function — typical use is SUMMARIZED views.

Each com.stigway.metamodels.highway.CodeInstruction view carries its owning function's mangled symbol in construct.mangledName; the loader already creates one com.stigway.metamodels.highway.CodeFunction per distinct inFunction value with that same mangled name. The fold builds an instruction-id → function-id remap on that equality, then rewrites every edge endpoint that points at an instruction to point at its owning function instead.

  • Self-loops produced by the remap (two instructions in the same function with an edge between them) are dropped.

  • Duplicate edges produced by the remap (many instruction-pair edges collapsing into one function-pair edge) are deduplicated by (source, target, kind).

  • The retained edge in a dedup group is the first one seen in input order, with its cascadingFault upgraded to true if any merged edge carried a cascading-fault flag.

Generated with STIG