Ignore:
Timestamp:
Nov 28, 2011, 3:13:14 PM (9 years ago)
Author:
tranquil
Message:
  • corrected previous bug
  • finished propagating immediates
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/RTLabs/RTLabsPrinter.ml

    r1568 r1572  
    3030  (Primitive.print_type t) ^ " " ^ (Register.print r)
    3131
    32 let rec print_args args =
    33   Printf.sprintf "[%s]" (MiscPottier.string_of_list ", " print_reg args)
    34 
    3532let print_result = function
    3633  | None -> "_"
     
    7572  | AST.Cst_offset off -> Printf.sprintf "imm_offset { %s }" (print_offset off)
    7673  | AST.Cst_sizeof t -> "imm_sizeof (" ^ (print_size t) ^ ")"
     74
     75let print_arg = function
     76  | RTLabs.Reg r -> print_reg r
     77  | RTLabs.Imm (c, t) ->
     78    Printf.sprintf "(%s)%s" (Primitive.print_type t) (print_cst c)
     79
     80let rec print_args args =
     81  Printf.sprintf "[%s]" (MiscPottier.string_of_list ", " print_arg args)
    7782
    7883let string_of_signedness = function
     
    9499  | AST.Op_intofptr -> "intofptr")
    95100        (print_reg r)
    96 
    97 let print_arg = function
    98   | RTLabs.Reg r -> print_reg r
    99   | RTLabs.Imm (c, t) ->
    100     Printf.sprintf "(%s)%s" (Primitive.print_type t) (print_cst c)
    101101
    102102let print_op2 op r s = Printf.sprintf "%s %s %s"
     
    246246        (print_table tbl)
    247247  | RTLabs.St_return None -> Printf.sprintf "return"
    248   | RTLabs.St_return (Some r) -> Printf.sprintf "return %s" (print_reg r)
     248  | RTLabs.St_return (Some r) -> Printf.sprintf "return %s" (print_arg r)
    249249
    250250
Note: See TracChangeset for help on using the changeset viewer.