================
@@ -1227,8 +1235,16 @@ class CodeGenFunction : public CodeGenTypeCache {
     /// PrivateGen is the address of the generated private variable.
     /// \return true if the variable is registered as private, false if it has
     /// been privatized already.
-    bool addPrivate(const VarDecl *LocalVD, Address Addr) {
+    bool addPrivate(const ValueDecl *LocalVD, Address Addr) {
       assert(PerformCleanup && "adding private to dead scope");
+      if (const auto *BD = dyn_cast<BindingDecl>(LocalVD->getCanonicalDecl())) 
{
+        auto It = CGF.OMPPrivatizedBindings.find(BD);
+        if (It != CGF.OMPPrivatizedBindings.end()) {
+          BindingChanges.emplace_back(BD, It->second);
+        } else {
+          BindingChanges.emplace_back(BD, std::nullopt);
+        }
----------------
alexey-bataev wrote:

```suggestion
        BindingChanges.emplace_back(BD, CGF.OMPPrivatizedBindings.lookup(BD));
```

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