let initial_state_contextfree_only_globals =
let module S =
State_builder.Option_ref
(Relations_type.Model)
(struct
let name = "contextfree_only_globals"
let dependencies =
[ Ast.self; Parameters.LibEntry.self; Parameters.MainFunction.self ]
let kind = `Internal
end)
in
function () ->
let add_varinfo state varinfo =
CurrentLoc.set varinfo.vdecl;
initialize_var_using_type varinfo state
in
let treat_global state = function
| GVar(vi,_,_) -> add_varinfo state vi
| GVarDecl(_,vi,_) when not (Cil.isFunctionType vi.vtype) ->
add_varinfo state vi
| GType _ | GCompTag _ | GCompTagDecl _ | GEnumTag _ | GEnumTagDecl _
| GVarDecl _ | GFun _ | GAsm _ | GPragma _ | GText _ | GAnnot _ -> state
in
let compute () =
List.fold_left treat_global (initial_state_only_globals())
(Ast.get ()).globals
in
S.memo compute