[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 21 13:34:54 PST 2020
ABataev added inline comments.
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15358-15360
+ if (!AE->getIdx()->isValueDependent())
+ if (AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext())) {
if (!Result.Val.getInt().isNullValue()) {
----------------
Simplify this nested ifs too, please.
================
Comment at: clang/test/OpenMP/target_messages.cpp:53-57
+ #pragma omp target map(foo()) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
+ int d;
+ #pragma omp target map(zee()) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
+ int e;
+ #pragma omp target map(this->zee()) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
----------------
You mapped `CallExpr`s here, not `DeclRef`s
================
Comment at: clang/test/OpenMP/target_messages.cpp:119-125
+ #pragma omp target map(foo()) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
+ foo();
+
+ S s;
+
+ #pragma omp target map(s.zee()) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
+ foo();
----------------
same here, mapped CallExprs
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74970/new/
https://reviews.llvm.org/D74970
More information about the cfe-commits
mailing list