Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add X86_proc.with_internal_assembler #10714

Merged
merged 1 commit into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes
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
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
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