[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 14:01:49 PDT 2019


ABataev added inline comments.


================
Comment at: clang/lib/Sema/TreeTransform.h:1987-2001
+  /// Build a new OpenMP 'defaultmap' clause.
+  ///
+  /// By default, performs semantic analysis to build the new OpenMP clause.
+  /// Subclasses may override this routine to provide different behavior.
+  OMPClause *RebuildOMPDefaultmapClause(OpenMPDefaultmapClauseModifier M,
+                                        OpenMPDefaultmapClauseKind Kind,
+                                        SourceLocation StartLoc,
----------------
cchen wrote:
> ABataev wrote:
> > Do you really need to rebuild it? It has only constants inside.
> I think you are right, the rebuild code for defaultmap seems redundant since it has only constant inside the function. I added this code so that my defaultmap(none) check inside DSAAttrChecker could be called for the second time (after template initialization). Without adding this code, the check in DSAAttrChecker for defaultmap(none) will never be called due to the guard in VisitDeclRefExpr:
> ```
>     if (E->isTypeDependent() || E->isValueDependent() ||
>         E->containsUnexpandedParameterPack() || E->isInstantiationDependent())
> ```
> Where do you think I should put my check for defaultmap(none) so that I don't need this redundant tree rebuild code? Thanks!
Ok, got it. Then better to rebuild the clause. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69204/new/

https://reviews.llvm.org/D69204





More information about the cfe-commits mailing list