From 0a500b73fc9bd6c6752c7bf0079e2305d0040303 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 14 Oct 2016 14:19:40 +0200 Subject: Remove undocumented option. Bug 20193 --- cparser/Rename.ml | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'cparser/Rename.ml') diff --git a/cparser/Rename.ml b/cparser/Rename.ml index c62c6763..c1f31977 100644 --- a/cparser/Rename.ml +++ b/cparser/Rename.ml @@ -43,17 +43,6 @@ let enter_public env id = re_public = StringMap.add id.name id env.re_public; re_used = StringSet.add id.name env.re_used } -let enter_static env id file = - try - let id' = StringMap.find id.name env.re_public in - { env with re_id = IdentMap.add id id' env.re_id } - with Not_found -> - let file = String.map (fun a -> match a with 'a'..'z' | 'A'..'Z' | '0'..'9' -> a | _ -> '_') file in - let id' = {id with name = Printf.sprintf "_%s_%s" file id.name} in - { re_id = IdentMap.add id id' env.re_id; - re_public = env.re_public; - re_used = StringSet.add id'.name env.re_used } - (* For static or local identifiers, we make up a new name if needed *) (* If the same identifier has already been declared, don't rename a second time *) @@ -260,7 +249,7 @@ let reserve_builtins () = (* Reserve global declarations with public visibility *) -let rec reserve_public env file = function +let rec reserve_public env = function | [] -> env | dcl :: rem -> let env' = @@ -268,27 +257,21 @@ let rec reserve_public env file = function | Gdecl(sto, id, _, _) -> begin match sto with | Storage_default | Storage_extern -> enter_public env id - | Storage_static -> if !Clflags.option_rename_static then - enter_static env id file - else - env + | Storage_static -> env | _ -> assert false end | Gfundef f -> begin match f.fd_storage with | Storage_default | Storage_extern -> enter_public env f.fd_name - | Storage_static -> if !Clflags.option_rename_static then - enter_static env f.fd_name file - else - env + | Storage_static -> env | _ -> assert false end | _ -> env in - reserve_public env' file rem + reserve_public env' rem (* Rename the program *) -let program p file = +let program p = globdecls - (reserve_public (reserve_builtins()) file p) + (reserve_public (reserve_builtins()) p) [] p -- cgit