Skip to content

Let's fix instead of reverting flambda_backend_args #396

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

Merged
merged 6 commits into from
Nov 22, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ want to modify the Flambda backend. Jump to:
- [Pulling changes onto a release branch](#pulling-changes-onto-a-release-branch)
- [Rebasing to a new major version of the upstream compiler](#rebasing-to-a-new-major-version-of-the-upstream-compiler)
- [How to add a new intrinsic to the compiler](#how-to-add-a-new-intrinsic-to-the-compiler)
- [How to add a new command line option](#how-to-add-a-new-command-line-option)
- [Installation tree comparison script](#installation-tree-comparison-script)

## Branches, pull requests, etc.
Expand Down Expand Up @@ -293,6 +294,17 @@ library, and then the compiler.
relies on the library tests to avoid duplication. Library tests use
`Core`, but the library itself does not.

## How to add a new command line option

1) Add a ref to `flambda_backend_flags.ml{i}`
2) Add the flag's constructor `mk_<flag>` in `flambda_backend_args.ml`
3) Add the callback for the new flag to `Flambda_backend_options` module type
in `flambda_backend_args.ml{i}`
4) List the flag in the body of `Make_flambda_backend_options` functor
5) Implement the flag in `Flambda_backend_options_impl`
by setting the corresponding ref in Flambda_backend_flags
6) Add the flag to `Extra_params` if it can be set via `OCAMLPARAM`

## Installation tree comparison script

A target `make compare` exists to run a comparison script that finds differences
Expand Down
4 changes: 2 additions & 2 deletions backend/asmgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ let compile_fundecl ~ppf_dump fd_cmm =
++ Profile.record ~accumulate:true "linearize" (fun (f : Mach.fundecl) ->
let res = Linearize.fundecl f in
(* CR xclerc for xclerc: temporary, for testing. *)
if !Clflags.use_ocamlcfg then begin
if !Flambda_backend_flags.use_ocamlcfg then begin
test_cfgize f res;
end;
res)
++ pass_dump_linear_if ppf_dump dump_linear "Linearized code"
++ Compiler_hooks.execute_and_pipe Compiler_hooks.Linear
++ (fun (fd : Linear.fundecl) ->
if !use_ocamlcfg then begin
if !Flambda_backend_flags.use_ocamlcfg then begin
fd
++ Profile.record ~accumulate:true "linear_to_cfg"
(Linear_to_cfg.run ~preserve_orig_labels:true)
Expand Down
Loading