aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Asmexpandaux.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-09-06 11:43:28 +0200
committerCyril SIX <cyril.six@kalray.eu>2018-09-06 15:59:07 +0200
commitd870e17a7a964b48d8e44195ccd12e4160a63f32 (patch)
tree3b16e98d6a1044be90dbff1642e3386ec276cb2d /backend/Asmexpandaux.ml
parent95926365caa7577f0936cdd4ab705d28b3d1457d (diff)
downloadcompcert-kvx-d870e17a7a964b48d8e44195ccd12e4160a63f32.tar.gz
compcert-kvx-d870e17a7a964b48d8e44195ccd12e4160a63f32.zip
Extraction issue
Diffstat (limited to 'backend/Asmexpandaux.ml')
-rw-r--r--backend/Asmexpandaux.ml16
1 files changed, 9 insertions, 7 deletions
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 *)