Instance TransfIfLink {A: Type} {LA: Linker A}
(flag: unit -> bool) (transf: A -> A -> Prop) (TL: TransfLink transf)
: TransfLink (match_if flag transf).
(** This is the list of compilation passes of CompCert in relational style. Each pass is characterized by a [match_prog] relation between its input code and its output code.  The [mkpass] and [:::] combinators, defined in module [Linking], ensure that the passes are composable (the output language of a pass is the input language of the next pass) and that they commute with linking (property [TransfLink], inferred by the type class mechanism of Coq). *)
Local Open Scope linking_scope.
Definition CompCert's_passes :=
mkpass SimplExprproof.match_prog
::: mkpass SimplLocalsproof.match_prog
::: mkpass Cshmgenproof.match_prog
::: mkpass Cminorgenproof.match_prog
::: mkpass Selectionproof.match_prog
::: mkpass RTLgenproof.match_prog
::: mkpass (match_if Compopts.optim_tailcalls Tailcallproof.match_prog)
::: mkpass Inliningproof.match_prog
::: mkpass Renumberproof.match_prog
::: mkpass (match_if Compopts.optim_constprop Constpropproof.match_prog)
::: mkpass (match_if Compopts.optim_constprop Renumberproof.match_prog)
::: mkpass (match_if Compopts.optim_CSE CSEproof.match_prog)
::: mkpass (match_if Compopts.optim_redundancy Deadcodeproof.match_prog)
::: mkpass Unusedglobproof.match_prog
::: mkpass Allocproof.match_prog
::: mkpass Tunnelingproof.match_prog
::: mkpass Linearizeproof.match_prog
::: mkpass CleanupLabelsproof.match_prog
::: mkpass (match_if Compopts.debug Debugvarproof.match_prog)
::: mkpass Stackingproof.match_prog
::: mkpass Asmgenproof.match_prog
::: pass_nil _.
(** Composing the [match_prog] relations above, we obtain the relation between CompCert C sources and Asm code that characterize CompCert's compilation. *)
Definition match_prog: Csyntax.program -> Asm.program -> Prop :=
pass_match (compose_passes CompCert's_passes).
(** The [transf_c_program] function, when successful, produces assembly code that is in the [match_prog] relation with the source C program. *)

Theorem transf_c_program_match:
forall p tp,
transf_c_program p = OK tp ->
match_prog p tp.