| 1177 | } |
| 1178 | |
| 1179 | pub fn prepare_context<E>( |
| 1180 | context: Context, |
| 1181 | inline_config: InlineConfig, |
| 1182 | evaluator: E, |
| 1183 | print_unoptimized_stats: bool, |
| 1184 | ) -> Result<Context> |
| 1185 | where |
| 1186 | E: Evaluator + Sized, |
| 1187 | { |
| 1188 | eprintln!("Instantiating..."); |
| 1189 | let context2 = run_instantiation_pass(context)?.get_context(); |
| 1190 | eprintln!("Inlining..."); |
| 1191 | let context3 = inline_operations(context2, inline_config)?; |
| 1192 | if print_unoptimized_stats { |
| 1193 | print_stats(context3.get_main_graph()?)?; |
| 1194 | } |
| 1195 | eprintln!("Optimizing..."); |
| 1196 | optimize_context(context3, evaluator) |
| 1197 | } |
| 1198 | |
| 1199 | /// Takes raw context (no inlining, etc.), and runs the whole pipeline (instantiation+inlining+MPC) on it, |
| 1200 | /// to prepare to be used in runtime. |