Home | History | Annotate | Download | only in Chapter5

Lines Matching full:builder

11 let builder = builder context
25 | '+' -> build_fadd lhs_val rhs_val "addtmp" builder
26 | '-' -> build_fsub lhs_val rhs_val "subtmp" builder
27 | '*' -> build_fmul lhs_val rhs_val "multmp" builder
30 let i = build_fcmp Fcmp.Ult lhs_val rhs_val "cmptmp" builder in
31 build_uitofp i double_type "booltmp" builder
47 build_call callee args "calltmp" builder
53 let cond_val = build_fcmp Fcmp.One cond zero "ifcond" builder in
57 let start_bb = insertion_block builder in
63 position_at_end then_bb builder;
69 let new_then_bb = insertion_block builder in
73 position_at_end else_bb builder;
78 let new_else_bb = insertion_block builder in
82 position_at_end merge_bb builder;
84 let phi = build_phi incoming "iftmp" builder in
87 position_at_end start_bb builder;
88 ignore (build_cond_br cond_val then_bb else_bb builder);
92 position_at_end new_then_bb builder; ignore (build_br merge_bb builder);
93 position_at_end new_else_bb builder; ignore (build_br merge_bb builder);
95 (* Finally, set the builder to the end of the merge block. *)
96 position_at_end merge_bb builder;
105 let preheader_bb = insertion_block builder in
111 ignore (build_br loop_bb builder);
114 position_at_end loop_bb builder;
117 let variable = build_phi [(start_val, preheader_bb)] var_name builder in
140 let next_var = build_add variable step_val "nextvar" builder in
147 let end_cond = build_fcmp Fcmp.One end_cond zero "loopcond" builder in
150 let loop_end_bb = insertion_block builder in
154 ignore (build_cond_br end_cond loop_bb after_bb builder);
157 position_at_end after_bb builder;
208 position_at_end bb builder;
214 let _ = build_ret ret_val builder in