Skip to content

Commit

Permalink
Add X86_proc.with_internal_assembler
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Oct 25, 2021
1 parent a7bf9cb commit 60de090
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ Working version
- #10692: Expose Parse.module_type and Parse.module_expr
(Guillaume Petiot, review by Gabriel Scherer)

- #10714: Add X86_proc.with_internal_assembler for temporarily changing the
assembler used by the backend.
(David Allsopp, review by Gabriel Scherer)

### Build system:

### Bug fixes:
Expand Down
2 changes: 2 additions & 0 deletions asmcomp/x86_proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ let string_of_rounding = function

let internal_assembler = ref None
let register_internal_assembler f = internal_assembler := Some f
let with_internal_assembler assemble k =
Misc.protect_refs [ R (internal_assembler, Some assemble) ] k

(* Which asm conventions to use *)
let masm =
Expand Down
2 changes: 2 additions & 0 deletions asmcomp/x86_proc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ val use_plt : bool
(** Support for plumbing a binary code emitter *)

val register_internal_assembler: (asm_program -> string -> unit) -> unit
val with_internal_assembler:
(asm_program -> string -> unit) -> (unit -> 'a) -> 'a

0 comments on commit 60de090

Please sign in to comment.