@@ -2112,108 +2112,9 @@ let data l =
2112
2112
emit_printf " \t .align\t 3\n " ;
2113
2113
List. iter emit_item l
2114
2114
2115
- let emit_line str = emit_string (str ^ " \n " )
2116
-
2117
2115
let file_emitter ~file_num ~file_name =
2118
2116
D. file ~file_num: (Some file_num) ~file_name
2119
2117
2120
- let build_asm_directives () : (module Asm_targets.Asm_directives_intf.S) =
2121
- (module Asm_targets.Asm_directives. Make (struct
2122
- let emit_line = emit_line
2123
-
2124
- let get_file_num file_name = Emitaux. get_file_num ~file_emitter file_name
2125
-
2126
- let debugging_comments_in_asm_files = ! Flambda_backend_flags. dasm_comments
2127
-
2128
- module D = struct
2129
- type constant = D.Directive.Constant .t
2130
-
2131
- let const_int64 num = D.Directive.Constant. Signed_int num
2132
-
2133
- let const_label str = D.Directive.Constant. Named_thing str
2134
-
2135
- let const_add c1 c2 = D.Directive.Constant. Add (c1, c2)
2136
-
2137
- let const_sub c1 c2 = D.Directive.Constant. Sub (c1, c2)
2138
-
2139
- (* CR sspies: The functions depending on [emit_directive] below break
2140
- abstractions. This is intensional at the moment, because this is only
2141
- the first step of getting rid of the first-class module entirely. *)
2142
- let emit_directive dir =
2143
- let buf = Buffer. create 80 in
2144
- D.Directive. print buf dir;
2145
- Buffer. add_string buf " \n " ;
2146
- Buffer. output_buffer ! output_channel buf
2147
-
2148
- let emit_constant const size =
2149
- emit_directive
2150
- (Const
2151
- { constant = D.Directive.Constant_with_width. create const size;
2152
- comment = None
2153
- })
2154
-
2155
- type data_type =
2156
- | NONE
2157
- | DWORD
2158
- | QWORD
2159
- | VEC128
2160
-
2161
- let file = file_emitter
2162
-
2163
- let loc ~file_num ~line ~col ?discriminator () =
2164
- ignore discriminator;
2165
- D. loc ~file_num ~line ~col ?discriminator ()
2166
-
2167
- let comment str = D. comment str
2168
-
2169
- let label ?data_type :_ str = emit_directive (New_label (str, Code ))
2170
-
2171
- let section ?delayed :_ name flags args =
2172
- match name, flags, args with
2173
- | [" .data" ], _ , _ -> D. data ()
2174
- | [" .text" ], _ , _ -> D. text ()
2175
- | name , flags , args -> D. switch_to_section_raw ~names: name ~flags ~args
2176
-
2177
- let text () = D. text ()
2178
-
2179
- let new_line () = D. new_line ()
2180
-
2181
- let global sym = emit_directive (Global sym)
2182
-
2183
- let protected sym = if not macosx then emit_directive (Protected sym)
2184
-
2185
- let type_ sym typ_ =
2186
- let typ_ : D.symbol_type =
2187
- match typ_ with
2188
- | "@function" -> Function
2189
- | "@object" -> Object
2190
- | "STT_FUNC" -> Function
2191
- | "STT_OBJECT" -> Object
2192
- | _ -> Misc. fatal_errorf " Unsupported assembly type %s" typ_
2193
- in
2194
- emit_directive (Type (sym, typ_))
2195
-
2196
- let byte const = emit_constant const Eight
2197
-
2198
- let word const = emit_constant const Sixteen
2199
-
2200
- let long const = emit_constant const Thirty_two
2201
-
2202
- let qword const = emit_constant const Sixty_four
2203
-
2204
- let bytes str = D. string str
2205
-
2206
- let uleb128 const =
2207
- emit_directive (Uleb128 { constant = const; comment = None })
2208
-
2209
- let sleb128 const =
2210
- emit_directive (Sleb128 { constant = const; comment = None })
2211
-
2212
- let direct_assignment var const =
2213
- emit_directive (Direct_assignment (var, const))
2214
- end
2215
- end ))
2216
-
2217
2118
(* Beginning / end of an assembly file *)
2218
2119
2219
2120
let begin_assembly _unix =
@@ -2246,8 +2147,8 @@ let begin_assembly _unix =
2246
2147
DSL. ins I. NOP [||];
2247
2148
emit_printf " \t .align\t 3\n " );
2248
2149
let lbl_end = Cmm_helpers. make_symbol " code_end" in
2249
- Emitaux.Dwarf_helpers. begin_dwarf ~build_asm_directives ~ code_begin: lbl_begin
2250
- ~code_end: lbl_end ~ file_emitter
2150
+ Emitaux.Dwarf_helpers. begin_dwarf ~code_begin: lbl_begin ~code_end: lbl_end
2151
+ ~file_emitter
2251
2152
2252
2153
let end_assembly () =
2253
2154
let lbl_end = Cmm_helpers. make_symbol " code_end" in
0 commit comments