diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-12 17:21:31 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-12 17:21:31 +0100 |
commit | 560c9837eee2145e3a9763aa2e37a6eb34c7e9ac (patch) | |
tree | d99e7bb815f1b058e7284e7a4f4c8fd260d8763c /backend/CSE3.v | |
parent | c6ebd73465ef895c6ea5e240f9c784463a6a0fe5 (diff) | |
download | compcert-kvx-560c9837eee2145e3a9763aa2e37a6eb34c7e9ac.tar.gz compcert-kvx-560c9837eee2145e3a9763aa2e37a6eb34c7e9ac.zip |
inductiveness test in CSE3
Diffstat (limited to 'backend/CSE3.v')
-rw-r--r-- | backend/CSE3.v | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/CSE3.v b/backend/CSE3.v index e82b7cdb..d54b9ffa 100644 --- a/backend/CSE3.v +++ b/backend/CSE3.v @@ -67,14 +67,17 @@ End REWRITE. Definition transf_function (f: function) : res function := do tenv <- type_function f; - let (invariants, hints) := preanalysis tenv f in + let (invariants, hints) := preanalysis tenv f in let ctx := context_from_hints hints in + if check_inductiveness (ctx:=ctx) tenv invariants f + then OK {| fn_sig := f.(fn_sig); fn_params := f.(fn_params); fn_stacksize := f.(fn_stacksize); fn_code := PTree.map (transf_instr (ctx := ctx) invariants) f.(fn_code); - fn_entrypoint := f.(fn_entrypoint) |}. + fn_entrypoint := f.(fn_entrypoint) |} + else Error (msg "cse3: not inductive"). Definition transf_fundef (fd: fundef) : res fundef := AST.transf_partial_fundef transf_function fd. |