aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Env.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-03-10 13:35:48 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2016-03-10 13:35:48 +0100
commit5b05d3668571bd9b748b781b0cc29ae10f745f61 (patch)
treeaa235b80ff0666c34332be46664ae289d8afaa2c /cparser/Env.ml
parent272087e1bc62bead1d1e1bea3d64e12d013eea37 (diff)
downloadcompcert-kvx-5b05d3668571bd9b748b781b0cc29ae10f745f61.tar.gz
compcert-kvx-5b05d3668571bd9b748b781b0cc29ae10f745f61.zip
Code cleanup.
Removed some unused variables, functions etc. and resolved some problems which occur if all warnings except 3,4,9 and 29 are active. Bug 18394.
Diffstat (limited to 'cparser/Env.ml')
-rw-r--r--cparser/Env.ml17
1 files changed, 3 insertions, 14 deletions
diff --git a/cparser/Env.ml b/cparser/Env.ml
index 65df6cb9..9ab5e657 100644
--- a/cparser/Env.ml
+++ b/cparser/Env.ml
@@ -118,15 +118,9 @@ let lookup_ident env s =
with Not_found ->
raise(Error(Unbound_identifier s))
-let lookup_tag env s =
- try
- IdentMap.lookup s env.env_tag
- with Not_found ->
- raise(Error(Unbound_tag(s, "tag")))
-
let lookup_struct env s =
try
- let (id, ci as res) = IdentMap.lookup s env.env_tag in
+ let (_, ci as res) = IdentMap.lookup s env.env_tag in
if ci.ci_kind <> Struct then
raise(Error(Tag_mismatch(s, "struct", "union")));
res
@@ -135,7 +129,7 @@ let lookup_struct env s =
let lookup_union env s =
try
- let (id, ci as res) = IdentMap.lookup s env.env_tag in
+ let (_, ci as res) = IdentMap.lookup s env.env_tag in
if ci.ci_kind <> Union then
raise(Error(Tag_mismatch(s, "union", "struct")));
res
@@ -169,11 +163,6 @@ let find_ident env id =
with Not_found ->
raise(Error(Unbound_identifier(id.name)))
-let find_tag env id =
- try IdentMap.find id env.env_tag
- with Not_found ->
- raise(Error(Unbound_tag(id.name, "tag")))
-
let find_struct env id =
try
let ci = IdentMap.find id env.env_tag in
@@ -256,7 +245,7 @@ let add_typedef env id info =
{ env with env_typedef = IdentMap.add id info env.env_typedef }
let add_enum env id info =
- let add_enum_item env (id, v, exp) =
+ let add_enum_item env (id, v, _) =
{ env with env_ident = IdentMap.add id (II_enum v) env.env_ident } in
List.fold_left add_enum_item
{ env with env_enum = IdentMap.add id info env.env_enum }