aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Env.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-01-24 10:29:30 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2017-01-24 10:29:30 +0100
commitd60b593c8b1d19a4adfdadaeeaa93aa10b9dba53 (patch)
tree838eef3aa4f09efd467971a51e6c76d49ebb8a59 /cparser/Env.ml
parent47e818992372c1480b1052b64728a33d758637cf (diff)
downloadcompcert-d60b593c8b1d19a4adfdadaeeaa93aa10b9dba53.tar.gz
compcert-d60b593c8b1d19a4adfdadaeeaa93aa10b9dba53.zip
New version to support designators.
The c standard allows member designators for offsetof. The current implementation works by recursively combining the offset of each of the member designators. For array access the size of the subtypes is multiplied by the index and for members the offset of the member is calculated. Bug 20765
Diffstat (limited to 'cparser/Env.ml')
-rw-r--r--cparser/Env.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/cparser/Env.ml b/cparser/Env.ml
index 5fa4571a..27d17a93 100644
--- a/cparser/Env.ml
+++ b/cparser/Env.ml
@@ -220,6 +220,8 @@ let find_union_member env (id, m) =
with Not_found ->
raise(Error(No_member(id.name, "union", m)))
+
+
let find_typedef env id =
try
IdentMap.find id env.env_typedef