Esempio n. 1
0
File: cilk.c Progetto: erikvarga/gcc
bool
cilk_recognize_spawn (tree exp, tree *exp0)
{
  bool spawn_found = false;
  if (TREE_CODE (exp) == CILK_SPAWN_STMT)
    {
      /* Remove the CALL_EXPR from CILK_SPAWN_STMT wrapper.  */
      exp = CILK_SPAWN_FN (exp);
      walk_tree (exp0, unwrap_cilk_spawn_stmt, NULL, NULL);
      spawn_found = true;
    }
  /* _Cilk_spawn can't be wrapped in expression such as PLUS_EXPR.  */
  else if (contains_cilk_spawn_stmt (exp))
    {
      location_t loc = EXPR_LOCATION (exp);
      if (loc == UNKNOWN_LOCATION)
	{
	  tree stmt = walk_tree (&exp,
				 contains_cilk_spawn_stmt_walker,
				 NULL,
				 NULL);
	  gcc_assert (stmt != NULL_TREE);
	  loc = EXPR_LOCATION (stmt);
	}
      error_at (loc, "invalid use of %<_Cilk_spawn%>");
    }
  return spawn_found;
}
Esempio n. 2
0
static tree
unwrap_cilk_spawn_stmt (tree *tp, int *walk_subtrees, void *)
{
  if (TREE_CODE (*tp) == CILK_SPAWN_STMT)
    {
      *tp = CILK_SPAWN_FN (*tp);
      *walk_subtrees = 0;
    }
  return NULL_TREE;
}
Esempio n. 3
0
File: cilk.c Progetto: Soufien/gcc
static bool
recognize_spawn (tree exp, tree *exp0)
{
  bool spawn_found = false;
  if (TREE_CODE (exp) == CILK_SPAWN_STMT)
    {
      /* Remove the CALL_EXPR from CILK_SPAWN_STMT wrapper.  */
      exp = CILK_SPAWN_FN (exp);
      walk_tree (exp0, unwrap_cilk_spawn_stmt, NULL, NULL);
      spawn_found = true;
    }
  return spawn_found;
}
Esempio n. 4
0
static bool
recognize_spawn (tree exp, tree *exp0)
{
  bool spawn_found = false;
  if (TREE_CODE (exp) == CILK_SPAWN_STMT)
    {
      /* Remove the CALL_EXPR from CILK_SPAWN_STMT wrapper.  */
      exp = CILK_SPAWN_FN (exp);
      walk_tree (exp0, unwrap_cilk_spawn_stmt, NULL, NULL);
      spawn_found = true;
    }
  /* _Cilk_spawn can't be wrapped in expression such as PLUS_EXPR.  */
  else if (contains_cilk_spawn_stmt (exp))
    error_at (EXPR_LOCATION (exp), "invalid use of %<_Cilk_spawn%>");
  return spawn_found;
}