Example #1
0
static void connect_cg(cgraph cg, struct endp from, struct endp to)
{
  gnode gfrom = endpoint_lookup(cg, &from), gto = endpoint_lookup(cg, &to);

  graph_add_edge(gfrom, gto, NULL);
  /* If an endpoint has args, we must also connect the node w/o args */
  if (from.args_node)
    graph_add_edge(fn_lookup(cg, from.function), gfrom, NULL);
  if (to.args_node)
    graph_add_edge(gto, fn_lookup(cg, to.function), NULL);
}
Example #2
0
global void
init_print(void)
{
	Func	*fn;

	e_return = NEW(Expr);
	e_return->e_class = E_RETURN;
	fn = fn_lookup(newstring("return"));
	ASSERT( fn != NULL );
	fn->f_code = success(e_return, 0);

	fn = fn_lookup(newstring("print"));
	ASSERT( fn != NULL );
	e_print = NEW(Expr);
	e_print->e_class = E_DEFUN;
	e_print->e_defun = fn;

	fn = fn_lookup(newstring("write_list"));
	ASSERT( fn != NULL );
	e_wr_list = NEW(Expr);
	e_wr_list->e_class = E_DEFUN;
	e_wr_list->e_defun = fn;
}