================
@@ -1152,9 +1152,14 @@ class CodeGenFunction : public CodeGenTypeCache {
     /// Sets the address of the variable \p LocalVD to be \p TempAddr in
     /// function \p CGF.
     /// \return true if at least one variable was set already, false otherwise.
-    bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD,
+    bool setVarAddr(CodeGenFunction &CGF, const ValueDecl *LocalVD,
                     Address TempAddr) {
-      LocalVD = LocalVD->getCanonicalDecl();
+      LocalVD = cast<ValueDecl>(LocalVD->getCanonicalDecl());
+      // For BindingDecls, also store by name for remapped lookup
+      if (const auto *BD = dyn_cast<BindingDecl>(LocalVD)) {
+        CGF.OMPPrivatizedBindingsByName.insert({BD->getName(), TempAddr});
----------------
alexey-bataev wrote:

What if the same decomposition decl is captured several times? Map would not be 
updated with the new address

https://github.com/llvm/llvm-project/pull/190832
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to