Пример #1
0
/**
 * osl_dependence_malloc function:
 * This function allocates the memory space for a osl_dependence_p structure and
 * sets its fields with default values. Then it returns a pointer to the
 * allocated space.
 * - 07/12/2005: first version.
 */
osl_dependence_p osl_dependence_malloc() {
  osl_dependence_p dependence;

  /* Memory allocation for the osl_dependence_p structure. */
  OSL_malloc(dependence, osl_dependence_p, sizeof(osl_dependence_t));

  /* We set the various fields with default values. */
  dependence->depth      = OSL_UNDEFINED;
  dependence->type       = OSL_UNDEFINED;
  dependence->label_source = OSL_UNDEFINED;
  dependence->label_target = OSL_UNDEFINED;
  dependence->ref_source = OSL_UNDEFINED;
  dependence->ref_target = OSL_UNDEFINED;
  dependence->domain     = NULL;
  dependence->next       = NULL;
  dependence->usr	       = NULL;
  dependence->source_nb_output_dims_domain = OSL_UNDEFINED;
  dependence->source_nb_output_dims_access = OSL_UNDEFINED;
  dependence->target_nb_output_dims_domain = OSL_UNDEFINED;
  dependence->target_nb_output_dims_access = OSL_UNDEFINED;
  dependence->source_nb_local_dims_domain  = OSL_UNDEFINED;
  dependence->source_nb_local_dims_access  = OSL_UNDEFINED;
  dependence->target_nb_local_dims_domain  = OSL_UNDEFINED;
  dependence->target_nb_local_dims_access  = OSL_UNDEFINED;
  dependence->ref_source_access_ptr = NULL;
  dependence->ref_target_access_ptr = NULL;
  dependence->stmt_source_ptr     = NULL;
  dependence->stmt_target_ptr     = NULL;

  return dependence;
}
Пример #2
0
/**
 * osl_scatnames_malloc function:
 * this function allocates the memory space for an osl_scatnames_t
 * structure and sets its fields with default values. Then it returns a
 * pointer to the allocated space.
 * \return A pointer to an empty scatnames structure with fields set to
 *         default values.
 */
osl_scatnames_p osl_scatnames_malloc() {
  osl_scatnames_p scatnames;

  OSL_malloc(scatnames, osl_scatnames_p, sizeof(osl_scatnames_t));
  scatnames->names = NULL;

  return scatnames;
}
Пример #3
0
/**
 * osl_textual_malloc function:
 * this function allocates the memory space for an osl_textual_t
 * structure and sets its fields with default values. Then it returns a
 * pointer to the allocated space.
 * \return A pointer to an empty textual structure with fields set to
 *         default values.
 */
osl_textual_p osl_textual_malloc() {
  osl_textual_p textual;

  OSL_malloc(textual, osl_textual_p, sizeof(osl_textual_t));
  textual->textual = NULL;

  return textual;
}
Пример #4
0
/**
 * osl_body_malloc function:
 * this function allocates the memory space for an osl_body_t
 * structure and sets its fields with default values. Then it returns a pointer
 * to the allocated space.
 * \return A pointer to an empty body with fields set to default values.
 */
osl_body_p osl_body_malloc() {
  osl_body_p body;

  OSL_malloc(body, osl_body_p, sizeof(osl_body_t));
  body->iterators    = NULL;
  body->expression   = NULL;

  return body;
}
Пример #5
0
/**
 * osl_loop_malloc function:
 * this function allocates the memory space for an osl_loop_t
 * structure and sets its fields with default values. Then it returns a
 * pointer to the allocated space.
 *
 * \return  A pointer to an empty loop structure with fields set to
 *          default values.
 */
osl_loop_p osl_loop_malloc() {
  osl_loop_p loop;

  OSL_malloc(loop, osl_loop_p, sizeof(osl_loop_t));
  loop->iter          = NULL;
  loop->nb_stmts      = 0;
  loop->stmt_ids      = NULL;
  loop->private_vars  = NULL;
  loop->directive     = 0;
  loop->next          = NULL;

  return loop;
}
Пример #6
0
/**
 * osl_scop_malloc function:
 * this function allocates the memory space for a osl_scop_t structure and
 * sets its fields with default values. Then it returns a pointer to the
 * allocated space.
 * \return A pointer to an empty scop with fields set to default values.
 */
osl_scop_p osl_scop_malloc() {
  osl_scop_p scop;

  OSL_malloc(scop, osl_scop_p, sizeof(osl_scop_t));
  scop->version        = 1;
  scop->language       = NULL;
  scop->context        = NULL;
  scop->parameters     = NULL;
  scop->statement      = NULL;
  scop->registry       = NULL;
  scop->extension      = NULL;
  scop->usr            = NULL;
  scop->next           = NULL;

  return scop;
}