[clang] Trying to fix undefined symbol error caused by iterator variable (PR #141507)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Tue May 27 10:08:45 PDT 2025
================
@@ -2969,6 +2969,11 @@ static LValue EmitGlobalVarDeclLValue(CodeGenFunction &CGF,
llvm::Value *V = CGF.CGM.GetAddrOfGlobalVar(VD);
+ if (VD->hasAttr<OMPIteratorAttr>()) {
+ llvm::GlobalVariable *Var = llvm::dyn_cast<llvm::GlobalVariable>(V);
+ Var->setInitializer(CGF.CGM.EmitNullConstant(E->getType()));
----------------
efriedma-quic wrote:
This is not the place to set an initializer for a variable.
For most variable definitions, there's a single location where it makes sense to "define" the variable.
https://github.com/llvm/llvm-project/pull/141507
More information about the cfe-commits
mailing list