On Wed, Sep 25, 2013 at 3:29 PM, Ilya Tocar <tocarip.in...@gmail.com> wrote: > On 24 Sep 11:02, Richard Biener wrote: >> On Mon, Sep 23, 2013 at 3:29 PM, Ilya Tocar <tocarip.in...@gmail.com> wrote: >> > Hi, >> > >> > I've rebased my patch. >> > Is it ok for gomp4 >> >> Passing through "is_omp" looks bad - please find a more suitable place >> to attach this meta-information. From a quick look you only need it to >> produce an alternate section name, > > Mostly for name, but there are other uses > (e. g. choosing decl states vector). > >> thus consider assigning the section >> name in a different place. >> >> Richard. > > What do you mean by different place? > I can add global dumping_omp_target variable to choose correct name, > depending on it's value (patch below). Is it better?
More like passing down a different abstraction, like for > @@ -907,9 +907,15 @@ output_symtab (void) > { > symtab_node node = lto_symtab_encoder_deref (encoder, i); > if (cgraph_node *cnode = dyn_cast <cgraph_node> (node)) > - lto_output_node (ob, cnode, encoder); > + { > + if (!dumping_omp_target || lookup_attribute ("omp declare target", > + DECL_ATTRIBUTES > (node->symbol.decl))) > + lto_output_node (ob, cnode, encoder); > + } > else > - lto_output_varpool_node (ob, varpool (node), encoder); > + if (!dumping_omp_target || lookup_attribute ("omp declare target", > + DECL_ATTRIBUTES > (node->symbol.decl))) > + lto_output_varpool_node (ob, varpool (node), encoder); > > } have the symtab encoder already not contain the varpool nodes you don't need. And instead of looking up attributes, mark the symtab node with a flag. Maybe Honza has some ideas on how to design this into the machinery rather than trying to fit in from the outside as well. Richard.