Operations to implement the client workers. In particular, it contains some simple fixpoint computations.
type ProgInfoStore a
= [(String, ProgInfo a)]
newProgInfoStoreRef
:: IO (IORef [(String, ProgInfo a)])
analysisClient
:: (Eq a, Show a, Read a, ReadWrite a) => Analysis a -> CConfig -> [String] -> IO ()
Analyze a list of modules (in the given order) with a given analysis. The analysis results are stored in the corresponding analysis result files.
analysisClientWithStore
:: (Eq a, Show a, Read a, ReadWrite a) => CConfig -> IORef [(String, ProgInfo a)] -> Analysis a -> String -> String -> IO ()
getInterfaceInfosWS
:: (Read a, ReadWrite a) => CConfig -> IORef [(String, ProgInfo a)] -> String -> [String] -> IO (ProgInfo a)
getStartValues
:: Analysis a -> Prog -> IO [((String, String), a)]
Compute the start (bottom) values for a dependency analysis.
funcInfos2ProgInfo
:: Prog -> [((String, String), a)] -> ProgInfo a
Compute a ProgInfo from a given list of infos for each function name w.r.t. a given program.
typeInfos2ProgInfo
:: Prog -> [((String, String), a)] -> ProgInfo a
Compute a ProgInfo from a given list of infos for each type name w.r.t. a given program.
map2
:: (a -> b) -> ([a], [a]) -> ([b], [b])
updateList
:: Eq a => [(a, b)] -> [(a, b)] -> [(a, b)]
Update a given value list (second argument) w.r.t. new values given in the first argument list.
updateValue
:: Eq a => (a, b) -> [(a, b)] -> [(a, b)]
execCombinedAnalysis
:: (Eq a, Read a) => CConfig -> Analysis a -> Prog -> ProgInfo a -> [((String, String), a)] -> String -> String -> IO (ProgInfo a)
runAnalysis
:: (Eq a, Read a) => CConfig -> Analysis a -> Prog -> ProgInfo a -> [((String, String), a)] -> String -> IO (ProgInfo a)
Run an analysis but load default values (e.g., for external operations) before and do not analyse the operations or types for these defaults.
executeAnalysis
:: Eq a => Analysis a -> Prog -> ProgInfo a -> [((String, String), a)] -> String -> ProgInfo a
Executes an anlysis on a given program w.r.t. an imported ProgInfo and some start values (for dependency analysis). The fixpoint iteration method to be applied is passed as the last argument.
unknownFixpointMessage
:: String
addCalledFunctions
:: FuncDecl -> (FuncDecl, [(String, String)])
Add the directly called functions to each function declaration.
addUsedTypes
:: TypeDecl -> (TypeDecl, [(String, String)])
Add the directly used type constructors to each type declaration.
consDeclsOfType
:: TypeDecl -> [ConsDecl]
Gets all constructors of datatype declaration.
simpleIteration
:: Eq b => (a -> [((String, String), b)] -> b) -> (a -> (String, String)) -> ([(a, [(String, String)])], [(a, [(String, String)])]) -> ProgInfo b -> ProgInfo b -> ProgInfo b
Fixpoint iteration to compute analysis information. The arguments are:
Result: fixpoint ProgInfo
wlIteration
:: (Eq a, Eq b) => (a -> [((String, String), b)] -> b) -> (a -> (String, String)) -> [(a, [(String, String)])] -> [(a, [(String, String)])] -> Map (String, String) () -> ProgInfo b -> Map (String, String) b -> Map (String, String) b
lookupError
:: String -> (String, String) -> a
isVisibleFunc
:: FuncDecl -> Bool
isVisibleType
:: TypeDecl -> Bool