Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 72 lines (54 sloc) 2.322 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 (**
20 Utils for main
21
22 @author Mathieu Barbin
23 @author Mehdi Bouaziz
24 @author Cédric Soulas
25 *)
26
27 (**
28 {6 Compiler options}
29 *)
30
31 module If =
32 struct
33 module E = OpaEnv
34
35 (* alphabetic order *)
36
37 let closure ~options _env = options.E.closure
38 let constant_sharing ~options _env = options.E.constant_sharing
39 let constant_sharing_client ~options _env = options.E.constant_sharing_client
40 let cps ~options _env = options.E.cps
41 let cps_client ~options _env = options.E.cps_client
42
43 let explicit_instantiation ~options _env = options.E.explicit_instantiation
44
45 let generate_interface ~options _env = options.E.generate_interface
46
47 let no_closure ~options _env = not options.E.closure
48 let no_discard_of_unused_stdlib ~options _env = options.E.no_discard_of_unused_stdlib
49 let no_server ~options _env = Option.default false options.E.no_server
50
51 let undot ~options _env = options.E.undot
52
53 let server ~options env = not (no_server ~options env)
54 let slicer_test ~options _env = options.E.slicer_test
55 let stdlib ~options _env = options.E.stdlib
56 let separated ~options:_ _env = not (ObjectFiles.global_compilation ())
57 let compilation ~options:_ _env =
58 match ObjectFiles.compilation_mode () with
59 | `compilation -> true
60 | `linking | `prelude | `init -> false
61
62 let init ~options:_ _env =
63 match ObjectFiles.compilation_mode () with
64 | `init -> true
65 | `linking | `prelude | `compilation -> false
66 let full_separation ~options:_ _env =
67 ObjectFiles.Arg.is_fully_separated ()
68 end
69
70 let if_not f_cond ~options env = not (f_cond ~options env)
71 let if_and f_cond1 f_cond2 ~options env = (f_cond1 ~options env) && (f_cond2 ~options env)
Something went wrong with that request. Please try again.