aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/SwitchNorm.mli
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2022-11-09 17:55:28 +0100
committerGitHub <noreply@github.com>2022-11-09 17:55:28 +0100
commitabe1f24dfb2b1b67dfeeaf3513e6d3d534f7df32 (patch)
tree2befd6d99593d99f1d0fd0ef520dd8bce0ebf86e /cparser/SwitchNorm.mli
parente637a49e7a963683a4337b742c0adc0e1f93f139 (diff)
parent5a9f24b4e739b6ef830f526845dd4d1557d0adee (diff)
downloadcompcert-abe1f24dfb2b1b67dfeeaf3513e6d3d534f7df32.tar.gz
compcert-abe1f24dfb2b1b67dfeeaf3513e6d3d534f7df32.zip
Merge pull request #459 from AbsInt/full-switch
Handle Duff's device and other unstructured `switch` statements
Diffstat (limited to 'cparser/SwitchNorm.mli')
-rw-r--r--cparser/SwitchNorm.mli28
1 files changed, 28 insertions, 0 deletions
diff --git a/cparser/SwitchNorm.mli b/cparser/SwitchNorm.mli
new file mode 100644
index 00000000..88e50dcd
--- /dev/null
+++ b/cparser/SwitchNorm.mli
@@ -0,0 +1,28 @@
+(* *********************************************************************)
+(* *)
+(* The Compcert verified compiler *)
+(* *)
+(* Xavier Leroy, Collège de France and Inria *)
+(* *)
+(* Copyright Institut National de Recherche en Informatique et en *)
+(* Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the GNU Lesser General Public License as *)
+(* published by the Free Software Foundation, either version 2.1 of *)
+(* the License, or (at your option) any later version. *)
+(* This file is also distributed under the terms of the *)
+(* INRIA Non-Commercial License Agreement. *)
+(* *)
+(* *********************************************************************)
+
+(* Normalization of structured "switch" statements
+ and emulation of unstructured "switch" statements (e.g. Duff's device) *)
+
+(* Assumes: nothing
+ Produces: code with normalized "switch" statements *)
+
+(* A normalized switch has the following form:
+ Sswitch(e, Sblock [ Slabeled(lbl1, case1); ...
+ Slabeled(lblN,caseN) ])
+*)
+
+val program: bool -> C.program -> C.program