diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2020-10-27 12:07:49 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2020-10-27 14:24:42 +0100 |
commit | 50ea7732118611a38e6aa6bced5c60dffb4eea3a (patch) | |
tree | dd6f8aa1787415b69d98d1a55756a7013ee1a0d3 /backend | |
parent | 3f99a42035389b1953030af8490a5ec18a64394f (diff) | |
download | compcert-kvx-50ea7732118611a38e6aa6bced5c60dffb4eea3a.tar.gz compcert-kvx-50ea7732118611a38e6aa6bced5c60dffb4eea3a.zip |
Reworked Duplicate to be parametrized
Diffstat (limited to 'backend')
-rw-r--r-- | backend/Duplicate.v | 26 | ||||
-rw-r--r-- | backend/Duplicateproof.v | 5 |
2 files changed, 26 insertions, 5 deletions
diff --git a/backend/Duplicate.v b/backend/Duplicate.v index 0e04b07d..6ae5475d 100644 --- a/backend/Duplicate.v +++ b/backend/Duplicate.v @@ -18,14 +18,28 @@ Require Import AST RTL Maps Globalenvs. Require Import Coqlib Errors Op. -Local Open Scope error_monad_scope. -Local Open Scope positive_scope. -(** External oracle returning the new RTL code (entry point unchanged), + +Module Type DuplicateParam. + + (** External oracle returning the new RTL code (entry point unchanged), along with the new entrypoint, and a mapping of new nodes to old nodes *) -Axiom duplicate_aux: function -> code * node * (PTree.t node). + Parameter duplicate_aux: function -> code * node * (PTree.t node). + +End DuplicateParam. + + -Extract Constant duplicate_aux => "Duplicateaux.duplicate_aux". +Module Duplicate (D: DuplicateParam). + +Export D. + +Definition duplicate_aux := duplicate_aux. + +(* Extract Constant duplicate_aux => "Duplicateaux.duplicate_aux". *) + +Local Open Scope error_monad_scope. +Local Open Scope positive_scope. (** * Verification of node duplications *) @@ -215,3 +229,5 @@ Definition transf_fundef (f: fundef) : res fundef := Definition transf_program (p: program) : res program := transform_partial_program transf_fundef p. + +End Duplicate. diff --git a/backend/Duplicateproof.v b/backend/Duplicateproof.v index 62455076..719ff8e9 100644 --- a/backend/Duplicateproof.v +++ b/backend/Duplicateproof.v @@ -17,6 +17,9 @@ Require Import AST Linking Errors Globalenvs Smallstep. Require Import Coqlib Maps Events Values. Require Import Op RTL Duplicate. +Module DuplicateProof (D: DuplicateParam). +Include Duplicate D. + Local Open Scope positive_scope. (** * Definition of [match_states] (independently of the translation) *) @@ -535,3 +538,5 @@ Proof. Qed. End PRESERVATION. + +End DuplicateProof. |