summaryrefslogtreecommitdiff
path: root/powerpc/PrintAsm.ml
diff options
context:
space:
mode:
Diffstat (limited to 'powerpc/PrintAsm.ml')
-rw-r--r--powerpc/PrintAsm.ml19
1 files changed, 3 insertions, 16 deletions
diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml
index 2264498..daa7f90 100644
--- a/powerpc/PrintAsm.ml
+++ b/powerpc/PrintAsm.ml
@@ -422,12 +422,10 @@ let print_annotation oc txt args res =
(* Printing of instructions *)
-module Labelset = Set.Make(struct type t = label let compare = compare end)
-
let float_literals : (int * int64) list ref = ref []
let jumptables : (int * label list) list ref = ref []
-let print_instruction oc labels = function
+let print_instruction oc = function
| Padd(r1, r2, r3) ->
fprintf oc " add %a, %a, %a\n" ireg r1 ireg r2 ireg r3
| Paddi(r1, r2, c) ->
@@ -654,8 +652,7 @@ let print_instruction oc labels = function
| Pxoris(r1, r2, c) ->
fprintf oc " xoris %a, %a, %a\n" ireg r1 ireg r2 constant c
| Plabel lbl ->
- if Labelset.mem lbl labels then
- fprintf oc "%a:\n" label (transl_label lbl)
+ fprintf oc "%a:\n" label (transl_label lbl)
| Pbuiltin(ef, args, res) ->
let name = extern_atom ef.ef_id in
if Str.string_match re_builtin_annotation name 0
@@ -673,16 +670,6 @@ let print_jumptable oc (lbl, tbl) =
(fun l -> fprintf oc " .long %a\n" label (transl_label l))
tbl
-let rec labels_of_code accu = function
- | [] ->
- accu
- | (Pb lbl | Pbf(_, lbl) | Pbt(_, lbl)) :: c ->
- labels_of_code (Labelset.add lbl accu) c
- | Pbtbl(_, tbl) :: c ->
- labels_of_code (List.fold_right Labelset.add tbl accu) c
- | _ :: c ->
- labels_of_code accu c
-
let print_function oc name code =
Hashtbl.clear current_function_labels;
float_literals := [];
@@ -693,7 +680,7 @@ let print_function oc name code =
if not (C2C.atom_is_static name) then
fprintf oc " .globl %a\n" symbol name;
fprintf oc "%a:\n" symbol name;
- List.iter (print_instruction oc (labels_of_code Labelset.empty code)) code;
+ List.iter (print_instruction oc) code;
if target <> MacOS then begin
fprintf oc " .type %a, @function\n" symbol name;
fprintf oc " .size %a, . - %a\n" symbol name symbol name