@@ -16,6 +16,7 @@ want to modify the Flambda backend. Jump to:
16
16
- [ Pulling changes onto a release branch] ( #pulling-changes-onto-a-release-branch )
17
17
- [ Rebasing to a new major version of the upstream compiler] ( #rebasing-to-a-new-major-version-of-the-upstream-compiler )
18
18
- [ How to add a new intrinsic to the compiler] ( #how-to-add-a-new-intrinsic-to-the-compiler )
19
+ - [ How to add a new command line option] ( #how-to-add-a-new-command-line-option )
19
20
- [ Installation tree comparison script] ( #installation-tree-comparison-script )
20
21
21
22
## Branches, pull requests, etc.
@@ -293,6 +294,17 @@ library, and then the compiler.
293
294
relies on the library tests to avoid duplication. Library tests use
294
295
` Core ` , but the library itself does not.
295
296
297
+ ## How to add a new command line option
298
+
299
+ 1 ) Add a ref to ` flambda_backend_flags.ml{i} `
300
+ 2 ) Add the flag's constructor ` mk_<flag> ` in ` flambda_backend_args.ml `
301
+ 3 ) Add the callback for the new flag to ` Flambda_backend_options ` module type
302
+ in ` flambda_backend_args.ml{i} `
303
+ 4 ) List the flag in the body of ` Make_flambda_backend_options ` functor
304
+ 5 ) Implement the flag in ` Flambda_backend_options_impl `
305
+ by setting the corresponding ref in Flambda_backend_flags
306
+ 6 ) Add the flag to ` Extra_params ` if it can be set via ` OCAMLPARAM `
307
+
296
308
## Installation tree comparison script
297
309
298
310
A target ` make compare ` exists to run a comparison script that finds differences
0 commit comments