File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,20 @@ let to_x86_constant_with_width (c : ND.Directive.Constant_with_width.t) :
67
67
68
68
let to_x86_directive (dir : ND.Directive.t ) : X86_ast.asm_line list =
69
69
let comment_lines comment =
70
- Option. to_list (Option. map (fun s -> X86_ast. Comment s) comment)
70
+ (* CR sspies: This check is usually done in the printing function of the new
71
+ directives. Since we are skipping those at the moment (by emitting via
72
+ the X86 DSL), we do the same check here in the conversion. *)
73
+ if ! Clflags. keep_asm_file && ! Flambda_backend_flags. dasm_comments
74
+ then Option. to_list (Option. map (fun s -> X86_ast. Comment s) comment)
75
+ else []
71
76
in
72
77
match dir with
73
78
| Align { bytes } ->
74
79
[X86_ast. Align (false , bytes)]
75
80
(* The data field is currently ignored by both assembler backends. The bytes
76
81
field is only converted to the final value when printing. *)
77
82
| Bytes { str; comment } -> comment_lines comment @ [X86_ast. Bytes str]
78
- | Comment s -> [ X86_ast. Comment s]
83
+ | Comment s -> comment_lines ( Some s)
79
84
| Const { constant; comment } ->
80
85
comment_lines comment @ [to_x86_constant_with_width constant]
81
86
| Direct_assignment (s , c ) ->
You can’t perform that action at this time.
0 commit comments