Lines Matching +full:class +full:- +full:dg

1 //===--- ModuleBuilder.cpp - Emit LLVM Code from ASTs ---------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
33 class CodeGeneratorImpl : public CodeGenerator {
43 /// Use this when emitting decls to block re-entrant decl emission. It will
55 unsigned Level = --Self.HandlingTopLevelDecls; in ~HandlingTopLevelDeclRAII()
72 if (ModuleName == "-" && !CGO.MainFileName.empty()) in ExpandModuleName()
106 return Builder->getModuleDebugInfo(); in getCGDebugInfo()
115 if (!Builder->lookupRepresentativeDecl(MangledName, Result)) in GetDeclForMangledName()
119 if (FD->hasBody(FD)) in GetDeclForMangledName()
122 if (auto Def = TD->getDefinition()) in GetDeclForMangledName()
129 return Builder->getMangledName(GD); in GetMangledName()
133 return Builder->GetAddrOfGlobal(global, ForDefinition_t(isForDefinition)); in GetAddrOfGlobal()
146 OldBuilder->moveLazyEmissionStates(Builder.get()); in StartModule()
154 M->setTargetTriple(Ctx->getTargetInfo().getTriple().getTriple()); in Initialize()
155 M->setDataLayout(Ctx->getTargetInfo().getDataLayoutString()); in Initialize()
156 const auto &SDKVersion = Ctx->getTargetInfo().getSDKVersion(); in Initialize()
158 M->setSDKVersion(SDKVersion); in Initialize()
159 if (const auto *TVT = Ctx->getTargetInfo().getDarwinTargetVariantTriple()) in Initialize()
160 M->setDarwinTargetVariantTriple(TVT->getTriple()); in Initialize()
162 Ctx->getTargetInfo().getDarwinTargetVariantSDKVersion()) in Initialize()
163 M->setDarwinTargetVariantSDKVersion(*TVSDKVersion); in Initialize()
169 Builder->AddDependentLib(Lib); in Initialize()
171 Builder->AppendLinkerOptions(Opt); in Initialize()
178 Builder->HandleCXXStaticMemberVarInstantiation(VD); in HandleCXXStaticMemberVarInstantiation()
181 bool HandleTopLevelDecl(DeclGroupRef DG) override { in HandleTopLevelDecl() argument
189 for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) in HandleTopLevelDecl()
190 Builder->EmitTopLevelDecl(*I); in HandleTopLevelDecl()
204 Builder->EmitTopLevelDecl(DeferredInlineMemberFuncDefs[I]); in EmitDeferredDecls()
212 assert(D->doesThisDeclarationHaveABody()); in HandleInlineFunctionDefinition()
227 if (!D->getLexicalDeclContext()->isDependentContext()) in HandleInlineFunctionDefinition()
228 Builder->AddDeferredUnusedCoverageMapping(D); in HandleInlineFunctionDefinition()
231 /// HandleTagDeclDefinition - This callback is invoked each time a TagDecl
232 /// to (e.g. struct, union, enum, class) is completed. This allows the
239 // Don't allow re-entrant calls to CodeGen triggered by PCH in HandleTagDeclDefinition()
243 Builder->UpdateCompletedType(D); in HandleTagDeclDefinition()
247 if (Ctx->getTargetInfo().getCXXABI().isMicrosoft()) { in HandleTagDeclDefinition()
248 for (Decl *Member : D->decls()) { in HandleTagDeclDefinition()
250 if (Ctx->isMSStaticDataMemberInlineDefinition(VD) && in HandleTagDeclDefinition()
251 Ctx->DeclMustBeEmitted(VD)) { in HandleTagDeclDefinition()
252 Builder->EmitGlobal(VD); in HandleTagDeclDefinition()
258 if (Ctx->getLangOpts().OpenMP) { in HandleTagDeclDefinition()
259 for (Decl *Member : D->decls()) { in HandleTagDeclDefinition()
261 if (Ctx->DeclMustBeEmitted(DRD)) in HandleTagDeclDefinition()
262 Builder->EmitGlobal(DRD); in HandleTagDeclDefinition()
264 if (Ctx->DeclMustBeEmitted(DMD)) in HandleTagDeclDefinition()
265 Builder->EmitGlobal(DMD); in HandleTagDeclDefinition()
275 // Don't allow re-entrant calls to CodeGen triggered by PCH in HandleTagDeclRequiredDefinition()
279 if (CodeGen::CGDebugInfo *DI = Builder->getModuleDebugInfo()) in HandleTagDeclRequiredDefinition()
281 DI->completeRequiredType(RD); in HandleTagDeclRequiredDefinition()
287 Builder->Release(); in HandleTranslationUnit()
293 Builder->clear(); in HandleTranslationUnit()
303 Builder->RefreshTypeCacheForClass(RD); in AssignInheritanceModel()
310 Builder->EmitTentativeDefinition(D); in CompleteTentativeDefinition()
314 Builder->EmitExternalDeclaration(D); in CompleteExternalDeclaration()
321 Builder->EmitVTable(RD); in HandleVTable()
329 return static_cast<CodeGeneratorImpl*>(this)->CGM(); in CGM()
333 return static_cast<CodeGeneratorImpl*>(this)->GetModule(); in GetModule()
337 return static_cast<CodeGeneratorImpl*>(this)->ReleaseModule(); in ReleaseModule()
341 return static_cast<CodeGeneratorImpl*>(this)->getCGDebugInfo(); in getCGDebugInfo()
345 return static_cast<CodeGeneratorImpl*>(this)->GetDeclForMangledName(name); in GetDeclForMangledName()
349 return static_cast<CodeGeneratorImpl *>(this)->GetMangledName(GD); in GetMangledName()
355 ->GetAddrOfGlobal(global, isForDefinition); in GetAddrOfGlobal()
360 return static_cast<CodeGeneratorImpl*>(this)->StartModule(ModuleName, C); in StartModule()