package goblint-cil
A front-end for the C programming language that facilitates program analysis and transformation
Install
Dune Dependency
Authors
Maintainers
Sources
goblint-cil-2.0.1.tbz
sha256=5f81cb3f25c09770e77b5eb4092e6621e456122b6d1219dcc304c062075f9572
sha512=31bb753031e0ef321a2ef065373009270881b1cce7f23167b378845188aed9cb49f18a165edd2e11f751f2c7a7b84ab5ac1da50ba1f5cb975e6e8a97157838ed
doc/src/goblint-cil.syntacticsearch/funcDatatype.ml.html
Source file funcDatatype.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
open GoblintCil (* Finds definition of a user-defined type *) let find_def name file = Util.list_filter_map (function | GType (info, loc) -> if String.compare name info.tname = 0 then Some ("", loc, name, -1) else None | GCompTag (info, loc) -> if String.compare name info.cname = 0 then Some ("", loc, name, -1) else None | GEnumTag (info, loc) -> if String.compare name info.ename = 0 then Some ("", loc, name, -1) else None | _ -> None) file.globals (* Finds all definition of user-defined types *) let find_def_all file = Util.list_filter_map (function | GType (info, loc) -> Some ("", loc, info.tname, -1) | GCompTag (info, loc) -> Some ("", loc, info.cname, -1) | GEnumTag (info, loc) -> Some ("", loc, info.ename, -1) | _ -> None) file.globals let find_in_globals list name = Util.list_filter_map (function | GVar (info, _, _) -> if String.compare name (String.trim (Pretty.sprint ~width:1 (d_type () info.vtype))) = 0 then Some info.vid else None | _ -> None) list let find_in_varinfos list name = Util.list_filter_map (fun info -> if String.compare name (String.trim (Pretty.sprint ~width:1 (d_type () info.vtype))) = 0 then Some info.vid else None) list let find_fundec globals name = let gfun = List.find_opt (function | GFun (fundec, _) -> String.compare fundec.svar.vname name = 0 | _ -> false) globals in match gfun with Some (GFun (fundec, _)) -> Some fundec | _ -> None let find_typevar_uses_in_fun list funname file = List.flatten @@ List.map (fun x -> FuncVar.find_uses_in_fun "" x funname file false) list (* Finds uses of a datatype in a function *) let find_uses_in_fun typename funname file = match find_fundec file.globals funname with | None -> [] | Some f -> find_typevar_uses_in_fun ( find_in_globals file.globals typename @ find_in_varinfos f.slocals typename @ find_in_varinfos f.sformals typename ) f.svar.vname file (* Finds all uses of a datatype in all functions *) let find_uses typename file = let list = FuncVar.find_uses_all file false in List.filter (fun (_, _, typ, _) -> String.compare typ typename = 0) list (* Finds all uses of a datatype in conditions *) let find_uses_in_cond typename file = let list = FuncVar.find_uses_in_cond_all file false in List.filter (fun (_, _, typ, _) -> String.compare typ typename = 0) list (* Finds all uses of a datatype in non-conditions *) let find_uses_in_noncond typename file = let list = FuncVar.find_uses_in_noncond_all file false in List.filter (fun (_, _, typ, _) -> String.compare typ typename = 0) list
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>