12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758(* This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at http://mozilla.org/MPL/2.0/. *)letconditional=reffalseletenabled()=match!conditionalwith|false->`Enabled|true->matchSys.getenv"BISECT_ENABLE"with|exceptionNot_found->`Disabled|swhen(String.uppercase[@ocaml.warning"-3"])s="YES"->`Enabled|_->`Disabledletconditional_exclude_filefilename=matchenabled()with|`Enabled->Exclusions.add_filefilename|`Disabled->()letswitches=[("-exclude",Arg.StringExclusions.add,"<pattern> Exclude functions matching pattern");("-exclude-file",Arg.Stringconditional_exclude_file,"<filename> Exclude functions listed in given file");("-mode",(Arg.Symbol(["safe";"fast";"faster"],ignore))," Ignored");("-conditional",Arg.Setconditional," Do not instrument unless environment variable BISECT_ENABLE is YES");]openMigrate_parsetreeopenPpx_tools_405let()=Driver.register~name:"bisect_ppx"~args:switchesVersions.ocaml_405beginfun_config_cookies->matchenabled()with|`Enabled->Ast_mapper_class.to_mapper(newInstrument.instrumenter)|`Disabled->Ast_405.shallow_identityend