[PATCH] D83922: [OpenMP] Fix map clause for unused var: don't ignore it

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 07:17:20 PDT 2020


ABataev added a comment.

I would add checks for mapping of `declare target to/link` vars and checked if they work in runtime.



================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9468-9469
                                          CurSizes, CurMapTypes, PartialStruct);
+        if (!CI->capturesThis())
+          MappedVarSet.insert(CI->getCapturedVar()->getCanonicalDecl());
+        else
----------------
I would check that we capture a variable. We may capture VLA here as well.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9470-9471
+          MappedVarSet.insert(CI->getCapturedVar()->getCanonicalDecl());
+        else
+          MappedVarSet.insert(nullptr);
         if (CurBasePointers.empty())
----------------
No need to insert `nullptr` here, it is not used later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83922





More information about the cfe-commits mailing list