Project

General

Profile

« Previous | Next » 

Revision 695db4da

Added by Guillaume DAVY over 4 years ago

Ada: - Replace MStep and Mbranch output by Null to have compilable Ada.
- Correct pp_value to print state access when the variable is memory

View differences:

src/backends/Ada/ada_backend_adb.ml
28 28
      @param var_name the name of the variable
29 29
      @param value the value to be assigned
30 30
   **)
31
  let pp_basic_assign fmt var_name value =
31
  let pp_basic_assign m fmt var_name value =
32 32
    fprintf fmt "%a := %a"
33 33
      pp_var_name var_name
34
      pp_value value
34
      (pp_value m) value
35 35

  
36 36
  (** Printing function for assignement. For the moment, only use
37 37
      [pp_basic_assign] function.
......
41 41
      @param var_name the name of the variable
42 42
      @param value the value to be assigned
43 43
   **)
44
  let pp_assign pp_var fmt var_name value = pp_basic_assign
44
  let pp_assign m pp_var fmt var_name value = pp_basic_assign m
45 45

  
46 46
  (* Printing function for reset function *)
47 47
  (* TODO: clean the call to extract_node *)
......
85 85
    | MReset ident ->
86 86
      pp_machine_reset machine fmt ident
87 87
    | MLocalAssign (ident, value) ->
88
      pp_basic_assign fmt ident value
88
      pp_basic_assign machine fmt ident value
89 89
    | MStateAssign (ident, value) ->
90
      pp_basic_assign fmt ident value
90
      pp_basic_assign machine fmt ident value
91 91
    | MStep ([i0], i, vl) when Basic_library.is_value_internal_fun
92 92
          (mk_val (Fun (i, vl)) i0.var_type)  ->
93
      fprintf fmt "MStep basic"
93
      fprintf fmt "Null"
94 94
    (* pp_machine_instr dependencies m self fmt
95 95
     *   (update_instr_desc instr (MLocalAssign (i0, mk_val (Fun (i, vl)) i0.var_type))) *)
96
    | MStep (il, i, vl) -> fprintf fmt "MStep"
96
    | MStep (il, i, vl) -> fprintf fmt "Null"
97 97

  
98 98
    (* pp_basic_instance_call m self fmt i vl il *)
99
    | MBranch (_, []) -> fprintf fmt "MBranch []"
99
    | MBranch (_, []) -> fprintf fmt "Null"
100 100

  
101 101
    (* (Format.eprintf "internal error: C_backend_src.pp_machine_instr %a@." (pp_instr m) instr; assert false) *)
102
    | MBranch (g, hl) -> fprintf fmt "MBranch gen"
102
    | MBranch (g, hl) -> fprintf fmt "Null"
103 103
    (* if let t = fst (List.hd hl) in t = tag_true || t = tag_false
104 104
     * then (\* boolean case, needs special treatment in C because truth value is not unique *\)
105 105
     *   (\* may disappear if we optimize code by replacing last branch test with default *\)

Also available in: Unified diff