Skip to content
Newer
Older
100644 50 lines (42 sloc) 1.73 KB
fccc685 Initial open-source release
MLstate authored Jun 21, 2011
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 (* this pass doesn't really depend on the slicer but it does depend on the bsl
19 * it could be moved elsewhere, but not to libqmlcompil *)
20 val discard_remote_bypasses :
21 bymap:BslLib.BSL.ByPassMap.t ->
22 lang:BslLanguage.t ->
23 QmlTypes.gamma ->
24 QmlAst.annotmap ->
25 QmlAst.code ->
26 (QmlTypes.gamma * QmlAst.annotmap) * QmlAst.code
27 (**
28 - Job:
29 This pass discards bypasses that are not defined in the current language
30 If they are really called at runtime, an exception will be thrown
31
32 - Precond:
978b7c4 @akoprow [fix] typo: occurence->occurrence, occured->occurred
akoprow authored Jul 9, 2011
33 It assumes bypass hoisting has occurred
fccc685 Initial open-source release
MLstate authored Jun 21, 2011
34
35 - Goal:
36 It is intended for tests, because when the code is not sliced you end up with client bypasses
37 in your server code or vice versa.
38
39 - More precise description of the job:
40 More precisely, non functional values are treated this way:
41 [x = \@expanded_bypass(%%max_int%%)
42 f() = x] becomes
43 [x(_) = error("max_int was called")
44 f() = x()]
45 And functional values are treated this way:
46 [bypass(x,y) = \@expanded_bypass(%%something%%(x,y))]
47 becomes
48 [bypass(_,_) = error("bypass something was called")]
49 *)
Something went wrong with that request. Please try again.