From d870e17a7a964b48d8e44195ccd12e4160a63f32 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Thu, 6 Sep 2018 11:43:28 +0200 Subject: Extraction issue --- backend/Asmexpandaux.ml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'backend/Asmexpandaux.ml') diff --git a/backend/Asmexpandaux.ml b/backend/Asmexpandaux.ml index 23fef3f2..62c4a702 100644 --- a/backend/Asmexpandaux.ml +++ b/backend/Asmexpandaux.ml @@ -26,7 +26,9 @@ let emit i = current_code := i :: !current_code (* Generation of fresh labels *) -let dummy_function = { fn_code = []; fn_sig = signature_main } +(** dummy_funtion is now defined in Asm.v *) +(* let dummy_function = { fn_code = []; fn_sig = signature_main } *) + let current_function = ref dummy_function let next_label = ref (None: label option) @@ -39,7 +41,7 @@ let new_label () = List.fold_left (fun next instr -> match instr with - | PExpand (Plabel l) -> if P.lt l next then next else P.succ l + | Plabel l -> if P.lt l next then next else P.succ l | _ -> next) P.one (!current_function).fn_code in @@ -100,17 +102,17 @@ let expand_debug id sp preg simple l = let get_lbl = function | None -> let lbl = new_label () in - emit (PExpand (Plabel lbl)); + emit (Plabel lbl); lbl | Some lbl -> lbl in let rec aux lbl scopes = function | [] -> () - | (PExpand (Pbuiltin(EF_debug (kind,txt,_x),args,_) as i))::rest -> + | (Pbuiltin(EF_debug (kind,txt,_x),args,_) as i)::rest -> let kind = (P.to_int kind) in begin match kind with | 1-> - emit (PExpand i);aux lbl scopes rest + emit i; aux lbl scopes rest | 2 -> aux lbl scopes rest | 3 -> @@ -142,11 +144,11 @@ let expand_debug id sp preg simple l = | _ -> aux None scopes rest end - | (PExpand (Plabel lbl))::rest -> simple (PExpand (Plabel lbl)); aux (Some lbl) scopes rest + | (Plabel lbl)::rest -> simple (Plabel lbl); aux (Some lbl) scopes rest | i::rest -> simple i; aux None scopes rest in (* We need to move all closing debug annotations before the last real statement *) let rec move_debug acc bcc = function - | (PExpand (Pbuiltin(EF_debug (kind,_,_),_,_)) as i)::rest -> + | (Pbuiltin(EF_debug (kind,_,_),_,_)) as i::rest -> let kind = (P.to_int kind) in if kind = 1 then move_debug acc (i::bcc) rest (* Do not move debug line *) -- cgit