• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/llvmCore-3425.0.34/examples/OCaml-Kaleidoscope/Chapter5/

Lines Matching refs:let

9 let context = global_context ()
10 let the_module = create_module context "my cool jit"
11 let builder = builder context
12 let named_values:(string, llvalue) Hashtbl.t = Hashtbl.create 10
13 let double_type = double_type context
15 let rec codegen_expr = function
21 let lhs_val = codegen_expr lhs in
22 let rhs_val = codegen_expr rhs in
30 let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
36 let callee =
41 let params = params callee in
46 let args = Array.map codegen_expr args in
49 let cond = codegen_expr cond in
52 let zero = const_float double_type 0.0 in
53 let cond_val = build_fcmp Fcmp.One cond zero "ifcond" builder in
57 let start_bb = insertion_block builder in
58 let the_function = block_parent start_bb in
60 let then_bb = append_block context "then" the_function in
64 let then_val = codegen_expr then_ in
69 let new_then_bb = insertion_block builder in
72 let else_bb = append_block context "else" the_function in
74 let else_val = codegen_expr else_ in
78 let new_else_bb = insertion_block builder in
81 let merge_bb = append_block context "ifcont" the_function in
83 let incoming = [(then_val, new_then_bb); (else_val, new_else_bb)] in
84 let phi = build_phi incoming "iftmp" builder in
101 let start_val = codegen_expr start in
105 let preheader_bb = insertion_block builder in
106 let the_function = block_parent preheader_bb in
107 let loop_bb = append_block context "loop" the_function in
117 let variable = build_phi [(start_val, preheader_bb)] var_name builder in
122 let old_val =
133 let step_val =
140 let next_var = build_add variable step_val "nextvar" builder in
143 let end_cond = codegen_expr end_ in
146 let zero = const_float double_type 0.0 in
147 let end_cond = build_fcmp Fcmp.One end_cond zero "loopcond" builder in
150 let loop_end_bb = insertion_block builder in
151 let after_bb = append_block context "afterloop" the_function in
171 let codegen_proto = function
174 let doubles = Array.make (Array.length args) double_type in
175 let ft = function_type double_type doubles in
176 let f =
195 let n = args.(i) in
201 let codegen_func the_fpm = function
204 let the_function = codegen_proto proto in
207 let bb = append_block context "entry" the_function in
211 let ret_val = codegen_expr body in
214 let _ = build_ret ret_val builder in
220 let _ = PassManager.run_function the_function the_fpm in