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/Parse.ml | 2 +- cparser/Rename.ml | 29 ++++++----------------------- cparser/Rename.mli | 2 +- 3 files changed, 8 insertions(+), 25 deletions(-) (limited to 'cparser') diff --git a/cparser/Parse.ml b/cparser/Parse.ml index 507aea36..dceb9b11 100644 --- a/cparser/Parse.ml +++ b/cparser/Parse.ml @@ -24,7 +24,7 @@ let transform_program t p name = (run_pass Unblock.program 'b' (run_pass Bitfields.program 'f' p)))) in - (Rename.program p1 (Filename.chop_suffix name ".c")) + (Rename.program p1) let parse_transformations s = let t = ref CharSet.empty in 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 diff --git a/cparser/Rename.mli b/cparser/Rename.mli index c4ef2228..818a51bc 100644 --- a/cparser/Rename.mli +++ b/cparser/Rename.mli @@ -13,4 +13,4 @@ (* *) (* *********************************************************************) -val program : C.program -> string -> C.program +val program : C.program -> C.program -- cgit