aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Env.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2020-07-20 11:55:35 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2020-07-20 16:27:00 +0200
commitb4c6087cd0faf3d165ca5450f7462b9fbe98796f (patch)
tree43a654c4382446241322379e12bd2d779f8572d8 /cparser/Env.ml
parent72f78307cec2ac8fb33d657b118a930b2acfe8ad (diff)
downloadcompcert-kvx-b4c6087cd0faf3d165ca5450f7462b9fbe98796f.tar.gz
compcert-kvx-b4c6087cd0faf3d165ca5450f7462b9fbe98796f.zip
Added error for redefined builtin.
We check in the initial environment if a function is already defined to avoid redefinition of functions that are part of the builtin environment.
Diffstat (limited to 'cparser/Env.ml')
-rw-r--r--cparser/Env.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/cparser/Env.ml b/cparser/Env.ml
index 4723a725..00806be1 100644
--- a/cparser/Env.ml
+++ b/cparser/Env.ml
@@ -316,6 +316,9 @@ let set_builtins blt =
List.iter Init.add_typedef blt.builtin_typedefs;
List.iter Init.add_function blt.builtin_functions
+let is_builtin name =
+ ident_is_bound !Init.env name
+
(* Error reporting *)
open Printf