aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Rename.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-10-14 14:19:40 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-10-14 14:19:40 +0200
commit0a500b73fc9bd6c6752c7bf0079e2305d0040303 (patch)
treec15710197018aaa71218072935d7284de7072376 /cparser/Rename.ml
parent7c8bd312880e96f84c15fad18dbffe3fd78397c7 (diff)
downloadcompcert-kvx-0a500b73fc9bd6c6752c7bf0079e2305d0040303.tar.gz
compcert-kvx-0a500b73fc9bd6c6752c7bf0079e2305d0040303.zip
Remove undocumented option. Bug 20193
Diffstat (limited to 'cparser/Rename.ml')
-rw-r--r--cparser/Rename.ml29
1 files changed, 6 insertions, 23 deletions
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