Add codegen for inout arguments
[hiphop-php.git] / hphp / hack / src / hhbc / hhas_method.ml
blobba637735e69d0c14e6f3a4f33ca3d6085ed5f0e5
1 (**
2 * Copyright (c) 2017, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the "hack" directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
9 *)
11 type t = {
12 method_attributes : Hhas_attribute.t list;
13 method_is_protected : bool;
14 method_is_public : bool;
15 method_is_private : bool;
16 method_is_static : bool;
17 method_is_final : bool;
18 method_is_abstract : bool;
19 method_no_injection : bool;
20 method_inout_wrapper : bool;
21 method_name : Hhbc_id.Method.t;
22 method_body : Hhas_body.t;
23 method_span : Hhas_pos.span;
24 method_is_async : bool;
25 method_is_generator : bool;
26 method_is_pair_generator : bool;
27 method_is_closure_body : bool;
30 let make
31 method_attributes
32 method_is_protected
33 method_is_public
34 method_is_private
35 method_is_static
36 method_is_final
37 method_is_abstract
38 method_no_injection
39 method_inout_wrapper
40 method_name
41 method_body
42 method_span
43 method_is_async
44 method_is_generator
45 method_is_pair_generator
46 method_is_closure_body = {
47 method_attributes;
48 method_is_protected;
49 method_is_public;
50 method_is_private;
51 method_is_static;
52 method_is_final;
53 method_is_abstract;
54 method_no_injection;
55 method_inout_wrapper;
56 method_name;
57 method_body;
58 method_span;
59 method_is_async;
60 method_is_generator;
61 method_is_pair_generator;
62 method_is_closure_body;
65 let attributes method_def = method_def.method_attributes
66 let is_protected method_def = method_def.method_is_protected
67 let is_private method_def = method_def.method_is_private
68 let is_public method_def = method_def.method_is_public
69 let is_static method_def = method_def.method_is_static
70 let is_final method_def = method_def.method_is_final
71 let is_abstract method_def = method_def.method_is_abstract
72 let no_injection method_def = method_def.method_no_injection
73 let inout_wrapper method_def = method_def.method_inout_wrapper
74 let name method_def = method_def.method_name
75 let with_name method_def method_name = { method_def with method_name }
76 let make_private method_def =
77 { method_def with
78 method_is_protected = false;
79 method_is_public = false;
80 method_is_private = true }
81 let body method_def = method_def.method_body
82 let span method_def = method_def.method_span
83 let is_async method_def = method_def.method_is_async
84 let is_generator method_def = method_def.method_is_generator
85 let is_pair_generator method_def = method_def.method_is_pair_generator
86 let is_closure_body method_def = method_def.method_is_closure_body
87 let with_body method_def method_body = { method_def with method_body }
88 let params m = m.method_body.Hhas_body.body_params
89 let return_type m = m.method_body.Hhas_body.body_return_type
90 let with_is_async m method_is_async = { m with method_is_async }