-
Notifications
You must be signed in to change notification settings - Fork 109
BE-227: HashQL: Implement call graph analysis for MIR #8214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bm/be-258-hashql-implement-transformationpass-changed-detection
Are you sure you want to change the base?
BE-227: HashQL: Implement call graph analysis for MIR #8214
Conversation
PR SummaryImplements inter-procedural call graph construction for MIR and plumbs definition IDs through bodies to enable cross-body analysis and debugging.
Written by Cursor Bugbot for commit 9d0c0ed. This will update automatically on new commits. Configure here. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
🤖 Augment PR SummarySummary: Adds an inter-procedural call graph analysis pass for HashQL MIR to track cross-definition references and call sites. Changes:
Technical Notes: Direct call edges are only emitted when the callee is syntactically a 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| fn run(&mut self, _: &mut MirContext<'env, 'heap>, body: &Body<'heap>) { | ||
| let mut visitor = CallGraphVisitor { | ||
| kind: CallKind::Opaque, | ||
| caller: body.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CallGraphAnalysis assumes body.id is a valid in-domain DefId; otherwise add_edge will panic (e.g., bodies produced by BodyBuilder::finish default to DefId::MAX unless overwritten). Consider asserting/documenting this precondition here to make failures easier to diagnose.
🤖 Was this useful? React with 👍 or 👎
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## bm/be-258-hashql-implement-transformationpass-changed-detection #8214 +/- ##
===================================================================================================
+ Coverage 59.15% 59.25% +0.10%
===================================================================================================
Files 1197 1201 +4
Lines 113726 114033 +307
Branches 5060 5060
===================================================================================================
+ Hits 67275 67572 +297
- Misses 45675 45685 +10
Partials 776 776
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #8214 will not alter performanceComparing Summary
|

Add call graph analysis for MIR
🌟 What is the purpose of this PR?
This PR adds a call graph analysis pass for MIR that tracks function call relationships between definitions. The call graph can be used for call site enumeration, reachability analysis, and optimization decisions.
🔍 What does this change?
CallGraphto represent function call relationships betweenDefIdsCallGraphAnalysispass to populate the graph from MIR bodiesCallKindenum to distinguish between direct function calls, filter functions, and other referencesidfield toBodystruct to track the definition ID of each bodyDisplayforLocationandGraphReadLocationto improve debuggingPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?