definition:
|
loadAnalysisWithImports :: (Eq a, Read a, Show a, ReadWrite a)
=> IORef (AnalysisStore a) -> Analysis a -> Verify.Options.Options -> Prog
-> IO (QName -> a)
loadAnalysisWithImports anastore analysis opts prog = do
maininfo <- getOrAnalyze (progName prog)
impinfos <- mapM getOrAnalyze (progImports prog)
return $ progInfo2Map $
foldr combineProgInfo maininfo (map publicProgInfo impinfos)
where
ananame = analysisName analysis
getOrAnalyze mname = do
AnaStore minfos <- readIORef anastore
maybe (do printWhenStatus opts $ "Getting " ++ ananame ++ " for '" ++
mname ++ "' via CASS..."
let cassopts = defaultCConfig
{ ccOptions = defaultOptions { optAll = True }}
minfo <- fmap (either id error) $
analyzeGenericWithOptions cassopts analysis mname
writeIORef anastore (AnaStore ((mname,minfo) : minfos))
return minfo)
return
(lookup mname minfos)
-- Transform the analysis information from CASS into a mapping from
-- names to analysis information.
progInfo2Map :: ProgInfo a -> (QName -> a)
progInfo2Map proginfo qf =
maybe (error $ ananame ++ "analysis information of '" ++ snd qf ++
"' not found!")
id
(lookupProgInfo qf proginfo)
|
demand:
|
no demanded arguments
|
deterministic:
|
deterministic operation
|
documentation:
|
-- Loads CASS analysis results for a module and its imported entities.
|
failfree:
|
<FAILING>
|
indeterministic:
|
might be indeterministic
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,_,_,_,_,_,_) |-> _}
|
name:
|
loadAnalysisWithImports
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
(Prelude.Eq a, Prelude.Read a, Prelude.Show a, RW.Base.ReadWrite a) => Data.IORef.IORef (AnalysisStore a)
-> Analysis.Types.Analysis a -> Verify.Options.Options -> FlatCurry.Types.Prog
-> Prelude.IO ((String, String) -> a)
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|