On Thu, Nov 13, 2014 at 11:03:47AM -0800, Cesar Philippidis wrote: > >> @@ -233,6 +242,90 @@ static tree scan_omp_1_op (tree *, int *, void *); > >> *handled_ops_p = false; \ > >> break; > >> > >> +/* Helper function to get the reduction array name */ > >> +static const char * > >> +omp_get_id (tree node) > > > > Be more specific in the function name what it is for? > > It's the name of the array containing the partial reductions for > original reduction variable. > > >> +{ > >> + const char *id = IDENTIFIER_POINTER (DECL_NAME (node)); > >> + int len = strlen ("omp$") + strlen (id); > >> + char *temp_name = (char *)alloca (len+1); > >> + snprintf (temp_name, len+1, "gfc$%s", id); > > > > gfc$ ? > > It's just a semi-random prefix I used to make the partial reduction > array identifier unique to aid with debugging. I was working on the > fortran front end at the time. Maybe s/gfc/oacc/?
Yeah, something (and please use the same string in the strlen and sprintf. If the symbol is emitted into assembly, you need to check for NO_DOLLARS_IN_LABELS and similar. Oh, and please use spaces around +. And name the function so that it is clear what is it for. Jakub