Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging: Treat inlines as if they were static when mergeInlines is off #86

Merged
merged 9 commits into from
Mar 28, 2022
6 changes: 6 additions & 0 deletions src/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ let varIdsEnv: (int, varinfo) H.t = H.create 117
* identifiers *)
let allVarIds: (int, varinfo) H.t = H.create 117

let fundecForVarIds: (int,unit) H.t = H.create 117

(* Also keep a list of environments. We place an empty string in the list to
* mark the start of a local environment (i.e. a function) *)
let varNamesList : (string * int) list ref = ref []
Expand Down Expand Up @@ -961,6 +963,9 @@ let rec checkGlobal = function
(* Check if this is the first occurrence *)
let vi = fd.svar in
let fname = vi.vname in
if H.mem fundecForVarIds vi.vid then
ignore (warn "There already is a different fundec for vid %d (%s)" vi.vid vi.vname);

E.withContext (fun _ -> dprintf "GFun(%s)" fname)
(fun _ ->
checkGlobal (GVarDecl (vi, l));
Expand Down Expand Up @@ -1072,6 +1077,7 @@ let checkFile flags fl =
H.clear varNamesEnv;
H.clear varIdsEnv;
H.clear allVarIds;
H.clear fundecForVarIds;
H.clear compNames;
H.clear compUsed;
H.clear enumUsed;
Expand Down
Loading