Skip to content
This repository
tree: a82af429c6
Fetching contributors…

Cannot retrieve contributors at this time

file 58 lines (45 sloc) 2.272 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
(*
Copyright © 2011 MLstate

This file is part of OPA.

OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.

OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.

You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
(**
Loading bsl plugins (bypass)
@author Mathieu Barbin
*)

(**
Load the BSL and any plug-in.

Plug-ins are .cma/.cmo/.cmxs files, as documented in the documentation of libbsl.
Plug-ins are first registered and then properly loaded.

Registration takes place in the following order:
- OPA standard bypass library (defined in module {!OpabslgenPlugin})
- files specified through command-line arguments {v *.opp v}, searched in the current
directory and directories specified through command-line option {v -I v} -- if several files
match the name specified, a warning is displayed and the first such file is used.
- plugin specified through source files, using the import-plugin syntax

Plugins are then sorted topologically by dependency.

Finally, plug-ins are loaded both by the common BSL and a backend-specific loader and
a dummy-backend bypass map is produced. This map contains all the bypasses -- if you
need to restrict to a subset, use {restrict_any} or {restrict_all}.

Loading is ensured by {!Dynlink} or {!Marshal}.
This pass fails and exits if a module cannot be loaded or
in case of circular dependencies.

This pass returns an bsl environment, which is a bymap (indexed bypasses)
and a list of plugins, sorted in a topologic order wrt their dependency order.
*)

val process :
  options: OpaEnv.opa_options ->
  code:(((_, _) SurfaceAst.code_elt ObjectFiles.parsed_code) as 'code) ->
  OpaEnv.opa_options * 'code * BslLib.env_bsl

(* (\** *)
(* The set of warnings raised by this pass. *)
(* *\) *)
(* val warning_set : WarningCalss.Set.t *)
Something went wrong with that request. Please try again.