summaryrefslogtreecommitdiff
path: root/asmcomp/arm
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2000-04-21 08:13:22 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2000-04-21 08:13:22 +0000
commit9abfff060e6e18cac2efd9abb5ca2db79ea6d312 (patch)
tree3576b6f4fb5d2c9f754ac61b6baa3fa35e89d6ef /asmcomp/arm
parentda86545caaac71be62c6815f41993dcfa1aed2fe (diff)
downloadocaml-9abfff060e6e18cac2efd9abb5ca2db79ea6d312.tar.gz
Suppression de Formatmsg, réécriture des messages à l'aide de Format.fprintf
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3123 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp/arm')
-rw-r--r--asmcomp/arm/arch.ml41
1 files changed, 19 insertions, 22 deletions
diff --git a/asmcomp/arm/arch.ml b/asmcomp/arm/arch.ml
index 1c9803792f..9a4d15be17 100644
--- a/asmcomp/arm/arch.ml
+++ b/asmcomp/arm/arch.ml
@@ -15,7 +15,7 @@
(* Specific operations for the ARM processor *)
open Misc
-open Formatmsg
+open Format
(* Addressing modes *)
@@ -57,29 +57,26 @@ let num_args_addressing (Iindexed n) = 1
(* Printing operations and addressing modes *)
-let print_addressing printreg addr arg =
+let print_addressing printreg addr ppf arg =
match addr with
- Iindexed n ->
- printreg arg.(0);
- if n <> 0 then printf " + %i" n
+ | Iindexed n ->
+ printreg ppf arg.(0);
+ if n <> 0 then fprintf ppf " + %i" n
-let print_specific_operation printreg op arg =
+let print_specific_operation printreg op ppf arg =
match op with
- Ishiftarith(op, shift) ->
- printreg arg.(0);
- begin match op with
- Ishiftadd -> print_string " + "
- | Ishiftsub -> print_string " - "
- | Ishiftsubrev -> print_string " -rev "
- end;
- printreg arg.(1);
- if shift >= 0
- then printf " << %i" shift
- else printf " >> %i" (-shift)
+ | Ishiftarith(op, shift) ->
+ let op_name = function
+ | Ishiftadd -> "+"
+ | Ishiftsub -> "-"
+ | Ishiftsubrev -> "-rev" in
+ let shift_mark =
+ if shift >= 0
+ then sprintf "<< %i" shift
+ else sprintf ">> %i" (-shift) in
+ fprintf ppf "%a %s %a %s"
+ printreg arg.(0) (op_name op) printreg arg.(1) shift_mark
| Ishiftcheckbound n ->
- print_string "check ";
- printreg arg.(0);
- printf " >> %i > " n;
- printreg arg.(1)
+ fprintf ppf "check %a >> %i > %a" printreg arg.(0) n printreg arg.(1)
| Irevsubimm n ->
- print_int n; print_string " - "; printreg arg.(0)
+ fprintf ppf "%i %s %a" n "-" printreg arg.(0)