From ca281a5ff122f136db761581f95110465b5eea31 Mon Sep 17 00:00:00 2001 From: xleroy Date: Fri, 18 Oct 2013 06:55:06 +0000 Subject: Revised renumbering of nodes and registers so that main function is not shifted by 1 git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2346 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- backend/Inlining.v | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'backend/Inlining.v') diff --git a/backend/Inlining.v b/backend/Inlining.v index 683d190..c6df3de 100644 --- a/backend/Inlining.v +++ b/backend/Inlining.v @@ -143,9 +143,9 @@ Qed. Program Definition add_instr (i: instruction): mon node := fun s => - let pc := Psucc s.(st_nextnode) in + let pc := s.(st_nextnode) in R pc - (mkstate s.(st_nextreg) pc (PTree.set pc i s.(st_code)) s.(st_stksize)) + (mkstate s.(st_nextreg) (Psucc pc) (PTree.set pc i s.(st_code)) s.(st_stksize)) _. Next Obligation. intros; constructor; simpl; xomega. @@ -213,9 +213,11 @@ Record context: Type := mkcontext { (** The following functions "shift" (relocate) PCs, registers, operations, etc. *) -Definition spc (ctx: context) (pc: node) := Pplus pc ctx.(dpc). +Definition shiftpos (p amount: positive) := Ppred (Pplus p amount). -Definition sreg (ctx: context) (r: reg) := Pplus r ctx.(dreg). +Definition spc (ctx: context) (pc: node) := shiftpos pc ctx.(dpc). + +Definition sreg (ctx: context) (r: reg) := shiftpos r ctx.(dreg). Definition sregs (ctx: context) (rl: list reg) := List.map (sreg ctx) rl. -- cgit v1.2.3