diff options
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 45dfcf5..d529688 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); } |