diff options
| author | Mehdi Amini <joker.eph@gmail.com> | 2025-08-14 15:36:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-14 15:36:46 +0200 |
| commit | df57d6a01e85ca78da2febab21b268d9fd6955a0 (patch) | |
| tree | 19b0aab453e6bc7e2b15d3220024dfdacd4fa57e /clang/lib/CIR/CodeGen/CIRGenModule.cpp | |
| parent | df86ea61b7ed484ca797f96d7ad40fd9ada7ba30 (diff) | |
| parent | 7bda76367f19cfc19086f68d9dd5ac019a9ceccd (diff) | |
Merge branch 'main' into users/joker-eph-python-bindings-maintainersusers/joker-eph-python-bindings-maintainers
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
| -rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index 45dfcf57b188..d5296881540a 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -438,6 +438,20 @@ void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd, errorNYI(funcDecl->getSourceRange(), "deferredAnnotations"); } +void CIRGenModule::handleCXXStaticMemberVarInstantiation(VarDecl *vd) { + VarDecl::DefinitionKind dk = vd->isThisDeclarationADefinition(); + if (dk == VarDecl::Definition && vd->hasAttr<DLLImportAttr>()) + return; + + TemplateSpecializationKind tsk = vd->getTemplateSpecializationKind(); + // If we have a definition, this might be a deferred decl. If the + // instantiation is explicit, make sure we emit it at the end. + if (vd->getDefinition() && tsk == TSK_ExplicitInstantiationDefinition) + getAddrOfGlobalVar(vd); + + emitTopLevelDecl(vd); +} + mlir::Operation *CIRGenModule::getGlobalValue(StringRef name) { return mlir::SymbolTable::lookupSymbolIn(theModule, name); } |
