On Mon, May 25, 2020 at 07:10:31PM +0200, Tobias Burnus wrote: > +enum omp_clause_defaultmap_kind > +cxx_omp_predetermined_mapping (tree decl) > +{ > + enum omp_clause_default_kind ret = cxx_omp_predetermined_sharing_1 (decl); > + if (ret != OMP_CLAUSE_DEFAULT_UNSPECIFIED) > + return OMP_CLAUSE_DEFAULTMAP_TO;
I don't like the above 3 lines, do you need it for anything? Static data members certainly aren't covered and it is unlikely we want to predetermine them mapped. > + /* Predetermine artificial variables holding integral values, those > + are usually result of gimplify_one_sizepos or SAVE_EXPR > + gimplification. */ > + if (VAR_P (decl) > + && DECL_ARTIFICIAL (decl) > + && INTEGRAL_TYPE_P (TREE_TYPE (decl)) > + && !(DECL_LANG_SPECIFIC (decl) > + && DECL_OMP_PRIVATIZED_MEMBER (decl))) > + return OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE; > + > + /* Similarly for typeinfo symbols. */ > + if (VAR_P (decl) && DECL_ARTIFICIAL (decl) && DECL_TINFO_P (decl)) > + return OMP_CLAUSE_DEFAULTMAP_TO; I think the typeinfo symbols and vtables we should implicitly mark declare target to, rather than trying to map them, that will not work properly anyway (they contain embedded function pointers). So I think the above 3 lines should go too. Otherwise LGTM. Jakub