[PATCH] D77414: [OpenMP] Add match_{all,any,none} declare variant selector extensions.

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 5 20:49:15 PDT 2020


jdoerfert marked an inline comment as done.
jdoerfert added a comment.

Will fix the other two nits too.



================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:1823
     ASTContext &ASTCtx = Actions.getASTContext();
-    TI.getAsVariantMatchInfo(ASTCtx, VMI, /* DeviceSetOnly */ true);
+    TI.getAsVariantMatchInfo(ASTCtx, VMI);
     OMPContext OMPCtx(ASTCtx.getLangOpts().OpenMPIsDevice,
----------------
mikerice wrote:
> One of the lit tests fails because this is called before semantic checks on the score expression.  This function tries to evaluate the score as a constant and if it isn't will crash.  Probably not specific to this change but how can we deal with that?
> 
> ```
> int foo(void);
> #pragma omp begin declare variant match(implementation={vendor(score(foo()) ibm)})
> #pragma omp end declare variant
> ```
Saw that too late but it's fixed now. We will ignore non-constant scores and evaluae non-constant user conditions as false. Note that both are not valid inputs we will diagnose later anyway.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77414





More information about the cfe-commits mailing list