From ec6d00d94bcb1a0adc5c698367634b5e2f370c6e Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 27 Sep 2008 08:57:55 +0000 Subject: 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 --- cfrontend/Cshmgen.v | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cfrontend/Cshmgen.v') diff --git a/cfrontend/Cshmgen.v b/cfrontend/Cshmgen.v index 20eb17f4..64a58ad0 100644 --- a/cfrontend/Cshmgen.v +++ b/cfrontend/Cshmgen.v @@ -383,11 +383,11 @@ Fixpoint transl_expr (a: Csyntax.expr) {struct a} : res expr := | Expr (Csyntax.Ecast ty b) _ => do tb <- transl_expr b; OK (make_cast (typeof b) ty tb) - | Expr (Csyntax.Eindex b c) ty => + | Expr (Csyntax.Econdition b c d) _ => do tb <- transl_expr b; do tc <- transl_expr c; - do ts <- make_add tb (typeof b) tc (typeof c); - make_load ts ty + do td <- transl_expr d; + OK(Econdition (make_boolean tb (typeof b)) tc td) | Expr (Csyntax.Eandbool b c) _ => do tb <- transl_expr b; do tc <- transl_expr c; @@ -425,10 +425,6 @@ with transl_lvalue (a: Csyntax.expr) {struct a} : res expr := OK (Eaddrof id) | Expr (Csyntax.Ederef b) _ => transl_expr b - | Expr (Csyntax.Eindex b c) _ => - do tb <- transl_expr b; - do tc <- transl_expr c; - make_add tb (typeof b) tc (typeof c) | Expr (Csyntax.Efield b i) ty => match typeof b with | Tstruct _ fld => -- cgit