From 17f519651feb4a09aa90c89c949469e8a5ab0e88 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 17 Aug 2014 07:52:12 +0000 Subject: - Support "switch" statements over 64-bit integers (in CompCert C to Cminor, included) - Translation of "switch" to decision trees or jumptables made generic over the sizes of integers and moved to the Cminor->CminorSel pass instead of CminorSel->RTL as before. - CminorSel: add "exitexpr" to support the above. - ValueDomain: more precise analysis of comparisons against an integer literal. E.g. "x >=u 0" is always true. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2565 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cfrontend/Cshmgen.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cfrontend/Cshmgen.v') diff --git a/cfrontend/Cshmgen.v b/cfrontend/Cshmgen.v index cedfd8b..3b23a54 100644 --- a/cfrontend/Cshmgen.v +++ b/cfrontend/Cshmgen.v @@ -589,7 +589,11 @@ Fixpoint transl_statement (tyret: type) (nbrk ncnt: nat) | Clight.Sswitch a sl => do ta <- transl_expr a; do tsl <- transl_lbl_stmt tyret 0%nat (S ncnt) sl; - OK (Sblock (Sswitch ta tsl)) + match classify_switch (typeof a) with + | switch_case_i => OK (Sblock (Sswitch false ta tsl)) + | switch_case_l => OK (Sblock (Sswitch true ta tsl)) + | switch_default => Error(msg "Cshmgen.transl_stmt(switch)") + end | Clight.Slabel lbl s => do ts <- transl_statement tyret nbrk ncnt s; OK (Slabel lbl ts) -- cgit v1.2.3