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