aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-28 13:36:53 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-28 13:36:53 +0200
commit5492b5b55afa68e3d628da07ff583a0cac79b7e3 (patch)
tree65fc4ad3276bc11d88c5b9ed3cf9f96f66425536 /powerpc/Asmexpand.ml
parent89476ea80ecfc7af02ef5026d0f45b61d243e3b0 (diff)
downloadcompcert-kvx-5492b5b55afa68e3d628da07ff583a0cac79b7e3.tar.gz
compcert-kvx-5492b5b55afa68e3d628da07ff583a0cac79b7e3.zip
Added location for the formal parameters and move the end of all
scopes before the last statement.
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r--powerpc/Asmexpand.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml
index 013d3f0a..80aa333e 100644
--- a/powerpc/Asmexpand.ml
+++ b/powerpc/Asmexpand.ml
@@ -647,7 +647,7 @@ let expand_instruction id l =
emit (Plabel lbl);
lbl
| Some lbl -> lbl in
- let rec aux lbl scopes = function
+ let rec aux lbl scopes = function
| [] -> let lbl = get_lbl lbl in
Debug.function_end id lbl
| (Pbuiltin(EF_debug (kind,txt,_x),args,_) as i)::rest ->
@@ -689,7 +689,13 @@ let expand_instruction id l =
aux None scopes rest
end
| i::rest -> expand_instruction_simple i; aux None scopes rest in
- aux None [] l
+ (* We need to move all closing debug annotations before the last real statement *)
+ let rec move_debug acc = function
+ | (Pbuiltin(EF_debug (kind,txt,_x),args,_) as i)::rest ->
+ move_debug (i::acc) rest (* Move the debug annotations forward *)
+ | b::rest -> List.rev (b::(List.rev acc)@rest) (* We found the first non debug location *)
+ | [] -> List.rev acc (* This actually can never happen *) in
+ aux None [] (move_debug [] (List.rev l))
let expand_function id fn =