From 36892f59ced6dd06d6a9cfc6e8af49db8721dd65 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 1 Oct 2015 13:28:14 +0200 Subject: Do not move the line directives. --- powerpc/Asmexpand.ml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'powerpc/Asmexpand.ml') diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index 5a365123..efd6cc0d 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -743,12 +743,16 @@ let expand_instruction id l = end | i::rest -> expand_instruction_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 = 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 *) + let rec move_debug acc bcc = function + | (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 *) + else + move_debug (i::acc) bcc rest (* Move the debug annotations forward *) + | b::rest -> List.rev ((List.rev (b::bcc)@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)) + aux None [] (move_debug [] [] (List.rev l)) let expand_function id fn = -- cgit