================
@@ -463,8 +478,11 @@ static LValue emitGlobalVarDeclLValue(CIRGenFunction &cgf, 
const Expr *e,
 
   // Check if the variable is marked as declare target with link clause in
   // device codegen.
-  if (cgf.getLangOpts().OpenMP)
-    cgf.cgm.errorNYI(e->getSourceRange(), "emitGlobalVarDeclLValue: OpenMP");
+  if (cgf.getLangOpts().OpenMPIsTargetDevice) {
+    Address addr = emitDeclTargetVarDeclLValue(cgf, e, vd);
+    if (addr.isValid())
+      return cgf.makeAddrLValue(addr, t, AlignmentSource::Decl);
+  }
----------------
steffenlarsen wrote:

The naming confuses me a little with these, as `emitDeclTargetVarDeclLValue` 
also ends with "LValue". Maybe it could use another name or, if all valid paths 
would go through `makeAddrLValue` anyway, maybe it could return a 
`std::optional<LValue>` and we'd just call `makeAddrLValue` in there?

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

Reply via email to