diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2008-09-27 08:57:55 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2008-09-27 08:57:55 +0000 |
commit | ec6d00d94bcb1a0adc5c698367634b5e2f370c6e (patch) | |
tree | 2e66a3c9211e2952cdfb50374c76baea6fa68eec /caml/Cil2Csyntax.ml | |
parent | 2cf153d684a48ed7ab910c77d9d98b4c9da3fe2e (diff) | |
download | compcert-ec6d00d94bcb1a0adc5c698367634b5e2f370c6e.tar.gz compcert-ec6d00d94bcb1a0adc5c698367634b5e2f370c6e.zip |
Clight: ajout Econdition, suppression Eindex.
caml/PrintCsyntax.ml: afficher les formes a[b] et a->fld.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@789 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'caml/Cil2Csyntax.ml')
-rw-r--r-- | caml/Cil2Csyntax.ml | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/caml/Cil2Csyntax.ml b/caml/Cil2Csyntax.ml index f736fb0c..7224610c 100644 --- a/caml/Cil2Csyntax.ml +++ b/caml/Cil2Csyntax.ml @@ -391,10 +391,6 @@ and convertExp = function let e = convertLval lv in (* array A of type T replaced by (T* )A *) Expr (Ecast (tPtr, e), tPtr) -(* - (* array A replaced by &(A[0]) *) - Expr (Eaddrof (Expr (Eindex (e, const0), t')), tPtr) -*) | _ -> internal_error "convertExp: StartOf applied to a \ lvalue whose type is not an array" @@ -427,8 +423,9 @@ and convertLval lv = end | Index (e', ofs) -> match t with - | Tarray (t', _) -> let e'' = Eindex (e, convertExp e') in - processOffset (Expr (e'', t')) ofs + | Tarray (t', _) -> + let e'' = Ederef(Expr (Ebinop(Oadd, e, convertExp e'), t)) in + processOffset (Expr (e'', t')) ofs | _ -> internal_error "processOffset: Index on a non-array" in (* convert the lvalue *) |