hashc
hashc copied to clipboard
Implement call graph querying
This issue relates to the compiler knowing about the call graph of the program. This will enable the following:
- optimise out dead code, functions which are never called and don't need to be lowered/optimised/code-gened.
- allow for a dead-code analysis reporting system.
This should be computed at some point during optimisations (or perhaps pre/mid optimisations) to rule out functions immediately from ever being lowered/optimised.
Additionally, it would nice if the compiler could emit a Graphviz represention of the program callgraph, via cmd args like: --show-call-graph
(which is an lowering specific option - maybe it could be used in TIR too?)