| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.Analysis.CallGraph
Description
This module exports functionality for generating a call graph of an Futhark program.
Synopsis
- data CallGraph
- buildCallGraph :: Prog SOACS -> CallGraph
- isFunInCallGraph :: Name -> CallGraph -> Bool
- calls :: Name -> Name -> CallGraph -> Bool
- calledByConsts :: Name -> CallGraph -> Bool
- allCalledBy :: Name -> CallGraph -> Set Name
- numOccurences :: CallGraph -> Map Name Int
Documentation
The call graph is a mapping from a function name, i.e., the caller, to a record of the names of functions called *directly* (not transitively!) by the function.
We keep track separately of the functions called by constants.
buildCallGraph :: Prog SOACS -> CallGraph Source #
buildCallGraph prog build the program's call graph.
isFunInCallGraph :: Name -> CallGraph -> Bool Source #
Is the given function known to the call graph?
calledByConsts :: Name -> CallGraph -> Bool Source #
Is the function called in any of the constants?