Lines Matching defs:GD
342 for (const GlobalDecl &GD : Aliases) {
343 const auto *D = cast<ValueDecl>(GD.getDecl());
350 StringRef MangledName = getMangledName(GD);
402 for (const GlobalDecl &GD : Aliases) {
403 StringRef MangledName = getMangledName(GD);
1073 GlobalDecl GD) const {
1074 const auto *D = dyn_cast<NamedDecl>(GD.getDecl());
1077 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType());
1094 GlobalDecl GD) const {
1095 setDLLImportDLLExport(GV, GD);
1096 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl()));
1199 // Returns true if GD is a function decl with internal linkage and
1201 static bool isUniqueInternalLinkageDecl(GlobalDecl GD,
1203 const Decl *D = GD.getDecl();
1205 (CGM.getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage);
1208 static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD,
1218 MC.mangleName(GD.getWithDecl(ND), Out);
1228 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) {
1243 if (ShouldMangle && isUniqueInternalLinkageDecl(GD, CGM)) {
1256 GD.getMultiVersionIndex(), Out);
1274 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD,
1283 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
1290 "Other GD should now be a multiversioned function");
1314 StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
1315 GlobalDecl CanonicalGD = GD.getCanonicalDecl();
1321 CXXCtorType OrigCtorType = GD.getCtorType();
1333 !getContext().mayExternalizeStaticVar(GD.getDecl())) {
1340 const auto *ND = cast<NamedDecl>(GD.getDecl());
1341 std::string MangledName = getMangledNameImpl(*this, GD, ND);
1360 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel),
1363 auto Result = Manglings.insert(std::make_pair(MangledName, GD));
1367 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD,
1370 const Decl *D = GD.getDecl();
1378 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out);
1380 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out);
1453 CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
1454 const auto *D = cast<FunctionDecl>(GD.getDecl());
1459 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType());
1480 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD,
1485 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv,
1895 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
1896 const Decl *D = GD.getDecl();
1898 setGVProperties(GV, GD);
1913 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD,
1921 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl());
1928 getContext().getFunctionFeatureMap(FeatureMap, GD);
1972 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
1974 const Decl *D = GD.getDecl();
1975 SetCommonAttributes(GD, GO);
1999 if (GetCPUAndFeaturesAttributes(GD, Attrs)) {
2021 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD,
2024 const Decl *D = GD.getDecl();
2025 SetLLVMFunctionAttributes(GD, FI, F, /*IsThunk=*/false);
2030 setNonAliasAttributes(GD, F);
2065 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
2076 const auto *FD = cast<FunctionDecl>(GD.getDecl());
2079 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F,
2085 if (!IsThunk && getCXXABI().HasThisReturn(GD) &&
2725 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) {
2726 StringRef Name = getMangledName(GD);
2738 APValue &V = GD->getAsAPValue();
2743 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType());
2749 MSGuidDecl::Parts Parts = GD->getParts();
2771 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType());
2835 void CodeGenModule::EmitGlobal(GlobalDecl GD) {
2836 const auto *Global = cast<ValueDecl>(GD.getDecl());
2845 return EmitAliasDefinition(GD);
2849 return emitIFuncDefinition(GD);
2853 return emitCPUDispatchDefinition(GD);
2883 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD))
2903 StringRef MangledName = getMangledName(GD);
2906 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
2909 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false,
2952 EmitGlobalDefinition(GD);
2964 StringRef MangledName = getMangledName(GD);
2967 addDeferredDeclToEmit(GD);
2971 addDeferredDeclToEmit(GD);
2976 DeferredDecls[MangledName] = GD;
3109 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
3110 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage)
3112 const auto *F = cast<FunctionDecl>(GD.getDecl());
3148 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD,
3150 const auto *FD = cast<FunctionDecl>(GD.getDecl());
3155 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr);
3158 EmitGlobalFunctionDefinition(GD, GV);
3161 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) {
3162 const auto *D = cast<ValueDecl>(GD.getDecl());
3171 if (!shouldEmitFunction(GD))
3186 ABI->emitCXXStructor(GD);
3188 EmitMultiVersionFunctionDefinition(GD, GV);
3190 EmitGlobalFunctionDefinition(GD, GV);
3193 getVTables().EmitThunks(GD);
3199 return EmitMultiVersionFunctionDefinition(GD, GV);
3200 return EmitGlobalFunctionDefinition(GD, GV);
3228 for (GlobalDecl GD : MVFuncsToEmit) {
3230 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl());
3232 FD, [this, &GD, &Options](const FunctionDecl *CurFD) {
3243 getTypes().arrangeGlobalDeclaration(GD);
3264 GetGlobalValue((getMangledName(GD) + ".resolver").str()));
3267 ResolverFunc = cast<llvm::Function>(GetGlobalValue(getMangledName(GD)));
3295 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) {
3296 const auto *FD = cast<FunctionDecl>(GD.getDecl());
3307 StringRef ResolverName = getMangledName(GD);
3318 ResolverGD = GD;
3333 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) +
3346 ExistingDecl = GD.getWithMultiVersionIndex(Index);
3394 *this, GD, FD, /*OmitMultiVersionMangling=*/true);
3398 AliasName, DeclTy, GD, /*ForVTable=*/false, /*DontDefer=*/true,
3401 DeclTy, 0, getFunctionLinkage(GD), AliasName, IFunc, &getModule());
3403 SetCommonAttributes(GD, GA);
3411 GlobalDecl GD, llvm::Type *DeclTy, const FunctionDecl *FD) {
3413 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
3431 MultiVersionFuncs.push_back(GD);
3465 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable,
3468 const Decl *D = GD.getDecl();
3475 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() &&
3480 GDDef = GlobalDecl(CD, GD.getCtorType());
3482 GDDef = GlobalDecl(DD, GD.getDtorType());
3491 UpdateMultiVersionNames(GD, FD);
3493 return GetOrCreateMultiVersionResolver(GD, Ty, FD);
3516 // Check that GD is not yet in DiagnosedConflictingDefinitions is required
3519 (GD.getCanonicalDecl().getDecl() !=
3521 DiagnosedConflictingDefinitions.insert(GD).second) {
3585 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk);
3597 GD.getDtorType()))
3598 addDeferredDeclToEmit(GD);
3628 addDeferredDeclToEmit(GD.getWithDecl(FD));
3649 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD,
3654 assert(!cast<FunctionDecl>(GD.getDecl())->isConsteval() &&
3658 const auto *FD = cast<FunctionDecl>(GD.getDecl());
3665 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) {
3667 GD.getDtorType() == Dtor_Complete &&
3669 GD = GlobalDecl(DD, Dtor_Base);
3672 StringRef MangledName = getMangledName(GD);
3673 auto *F = GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer,
3678 cast<FunctionDecl>(GD.getDecl())->hasAttr<CUDAGlobalAttr>()) {
3680 cast<llvm::Function>(F->stripPointerCasts()), GD);
3991 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) {
3992 const Decl *D = GD.getDecl();
3995 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr,
4002 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
4007 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
4009 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
4796 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
4798 const auto *D = cast<FunctionDecl>(GD.getDecl());
4801 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
4806 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false,
4819 setFunctionLinkage(GD, Fn);
4822 setGVProperties(Fn, GD);
4831 CodeGenFunction(*this).GenerateCode(GD, Fn, FI);
4833 setNonAliasAttributes(GD, Fn);
4844 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
4845 const auto *D = cast<ValueDecl>(GD.getDecl());
4849 StringRef MangledName = getMangledName(GD);
4862 Aliases.push_back(GD);
4871 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD,
4873 LT = getFunctionLinkage(GD);
4877 if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl()))
4880 LT = getFunctionLinkage(GD);
4924 SetCommonAttributes(GD, GA);
4927 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {
4928 const auto *D = cast<ValueDecl>(GD.getDecl());
4932 StringRef MangledName = getMangledName(GD);
4944 DiagnosedConflictingDefinitions.insert(GD).second) {
4953 Aliases.push_back(GD);
4957 GetOrCreateLLVMFunction(IFA->getResolver(), DeclTy, GD,
4984 SetCommonAttributes(GD, GIF);
5993 GlobalDecl GD(cast<FunctionDecl>(D));
5994 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
5995 getFunctionLinkage(GD));
6000 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base);
6001 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
6002 getFunctionLinkage(GD));
6007 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base);
6008 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
6009 getFunctionLinkage(GD));
6117 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D));
6118 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV);