Skip to content

Internalize 5 dag.hpp functions with no external callers#39

Merged
typeless merged 1 commit intomainfrom
refactor/internalize-dag-functions
Apr 13, 2026
Merged

Internalize 5 dag.hpp functions with no external callers#39
typeless merged 1 commit intomainfrom
refactor/internalize-dag-functions

Conversation

@typeless
Copy link
Copy Markdown
Owner

Summary

Remove 5 functions from the public dag.hpp header — none had callers outside dag.cpp:

Function Reason internal
validate_node_id Only called by add_edge within dag.cpp
add_phi_node Phi-node lifecycle is entirely internal
get_phi_node (×2) Same — only resolve_phi_node calls it
resolve_phi_node Only called within dag.cpp
leaf_nodes No production callers

Also removes leaf_nodes test sections (testing an internal function) and swaps get_phi_node overload order so the const version precedes the mutable one (needed without the header forward-declaring both).

Public API: 57 → 52 functions. Net −39 lines.

Test plan

  • All 456 tests pass (23563 assertions — 7 fewer from removed leaf_nodes tests)
  • clang-format clean

🤖 Generated with Claude Code

Remove from public header (no callers outside dag.cpp):
- validate_node_id: only used by add_edge internally
- add_phi_node, get_phi_node, resolve_phi_node: phi-node lifecycle
  is entirely internal to the DAG
- leaf_nodes: no production callers (test-only)

Also removes leaf_nodes test sections since the function is now
internal. Swaps get_phi_node overload order so const precedes
mutable (needed without the header forward-declaring both).

Public API: 57 → 52 functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@typeless typeless merged commit 7e57723 into main Apr 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant