[all-commits] [llvm/llvm-project] 528574: Fix assert on the variable which is used in omp cl...

jyu2-git via All-commits all-commits at lists.llvm.org
Tue May 4 09:15:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5285748c2c764c1d7fb3f882ba9f11ed79f676a1
      https://github.com/llvm/llvm-project/commit/5285748c2c764c1d7fb3f882ba9f11ed79f676a1
  Author: Jennifer Yu <jennifer.yu at intel.com>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/test/OpenMP/constexpr_capture.cpp

  Log Message:
  -----------
  Fix assert on the variable which is used in omp clause is not marked
as used.

The problem only happens with constexpr variable, for constexpr variable,
variable is not marked during parser variable.   This is because compiler
might find some var's associate expressions may not actully an odr-used
later,  the variables get kept in MaybeODRUseExprs, in normal case, at
end of process fullExpr, the variable will be marked during the call to
CleanupVarDeclMarking(). Since we are processing expression of OpenMP
clauses, and the ActOnFinishFullExpr is not getting called that casue
variable is not get marked.

One way to fix this is to call CleanupVarDeclMarking() in EndOpenMPClause
for each omp directive.

This to fix https://bugs.llvm.org/show_bug.cgi?id=50206

Differential Revision: https://reviews.llvm.org/D101781




More information about the All-commits mailing list