diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-10-01 13:28:14 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-10-01 13:28:14 +0200 |
commit | 36892f59ced6dd06d6a9cfc6e8af49db8721dd65 (patch) | |
tree | 8cfd3d62516762266274dd6911256c51f4996c68 | |
parent | 7483a40054d5b54484317e8d252d0820d0e282e2 (diff) | |
download | compcert-36892f59ced6dd06d6a9cfc6e8af49db8721dd65.tar.gz compcert-36892f59ced6dd06d6a9cfc6e8af49db8721dd65.zip |
Do not move the line directives.
-rw-r--r-- | powerpc/Asmexpand.ml | 14 |
1 files changed, 9 insertions, 5 deletions
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 = |