Lines Matching defs:dp

88 dt_sugar_append_clause(dt_sugar_parse_t *dp, dt_node_t *clause)
90 dp->dtsp_clause_list = dt_node_link(dp->dtsp_clause_list, clause);
97 dt_sugar_prepend_clause(dt_sugar_parse_t *dp, dt_node_t *clause)
99 dp->dtsp_clause_list = dt_node_link(clause, dp->dtsp_clause_list);
142 dt_sugar_new_condition_impl(dt_sugar_parse_t *dp,
171 return (dt_node_clause(dp->dtsp_pdescs, newpred, body));
180 dt_sugar_new_condition(dt_sugar_parse_t *dp, dt_node_t *pred, int condid)
182 dp->dtsp_num_conditions++;
183 dt_sugar_append_clause(dp, dt_sugar_new_condition_impl(dp,
184 pred, condid, dp->dtsp_num_conditions));
185 return (dp->dtsp_num_conditions);
193 dt_sugar_visit_all(dt_sugar_parse_t *dp, dt_node_t *dnp)
210 dt_sugar_visit_all(dp, arg);
214 dt_sugar_visit_all(dp, dnp->dn_child);
218 dt_sugar_visit_all(dp, dnp->dn_left);
219 dt_sugar_visit_all(dp, dnp->dn_right);
223 dt_sugar_visit_all(dp, ln->dn_list);
230 dt_sugar_visit_all(dp, dnp->dn_expr);
231 dt_sugar_visit_all(dp, dnp->dn_left);
232 dt_sugar_visit_all(dp, dnp->dn_right);
237 dt_sugar_visit_all(dp, dnp->dn_expr);
242 dt_sugar_visit_all(dp, arg);
245 dt_sugar_visit_all(dp, dnp->dn_aggfun);
250 dt_sugar_visit_all(dp, arg);
253 dt_sugar_visit_all(dp, dnp->dn_pred);
256 dt_sugar_visit_all(dp, arg);
262 dt_sugar_visit_all(dp, inp->din_root);
267 dt_sugar_visit_all(dp, dnp->dn_membexpr);
272 dt_sugar_visit_all(dp, arg);
277 dt_sugar_visit_all(dp, arg);
282 dt_sugar_visit_all(dp, arg);
286 dp->dtsp_num_ifs++;
287 dt_sugar_visit_all(dp, dnp->dn_conditional);
290 dt_sugar_visit_all(dp, arg);
293 dt_sugar_visit_all(dp, arg);
313 dt_sugar_new_clearerror_clause(dt_sugar_parse_t *dp)
317 return (dt_node_clause(dp->dtsp_pdescs, NULL, stmt));
325 dt_sugar_do_if(dt_sugar_parse_t *dp, dt_node_t *if_stmt, int precondition)
332 newid = dt_sugar_new_condition(dp,
336 dt_sugar_visit_stmts(dp, if_stmt->dn_body, newid);
346 dt_sugar_visit_stmts(dp, if_stmt->dn_alternate_body,
347 dt_sugar_new_condition(dp, pred, precondition));
362 dt_sugar_new_basic_block(dt_sugar_parse_t *dp, int condid, dt_node_t *stmts)
372 if (dp->dtsp_num_conditions != 0) {
381 dt_sugar_append_clause(dp,
382 dt_node_clause(dp->dtsp_pdescs, pred, stmts));
390 dt_sugar_visit_stmts(dt_sugar_parse_t *dp, dt_node_t *stmts, int precondition)
418 dt_sugar_new_basic_block(dp, precondition,
422 dt_sugar_do_if(dp, stmt, precondition);
431 dt_sugar_new_basic_block(dp, precondition,
463 dt_sugar_parse_t dp = { 0 };
466 dp.dtsp_dtp = dtp;
467 dp.dtsp_pdescs = clause->dn_pdescs;
474 dt_sugar_visit_all(&dp, clause);
476 if (dp.dtsp_num_ifs == 0 && dp.dtsp_num_conditions == 0) {
484 dt_sugar_append_clause(&dp, dt_node_clause(clause->dn_pdescs,
488 condid = dt_sugar_new_condition(&dp,
499 dt_sugar_new_basic_block(&dp, condid, NULL);
501 dt_sugar_visit_stmts(&dp, clause->dn_acts, condid);
505 if (dp.dtsp_num_conditions != 0) {
506 dt_sugar_prepend_clause(&dp,
507 dt_sugar_new_clearerror_clause(&dp));
510 if (dp.dtsp_clause_list != NULL &&
511 dp.dtsp_clause_list->dn_list != NULL && !dtp->dt_has_sugar) {
513 dt_sugar_prepend_clause(&dp, dt_sugar_makeerrorclause());
515 return (dp.dtsp_clause_list);