Lines Matching defs:GD
665 for (const GlobalDecl &GD : Aliases) {
666 const auto *D = cast<ValueDecl>(GD.getDecl());
676 StringRef MangledName = getMangledName(GD);
735 for (const GlobalDecl &GD : Aliases) {
736 StringRef MangledName = getMangledName(GD);
945 GlobalDecl GD;
947 GD = GlobalDecl(FD, KernelReferenceKind::Kernel);
949 GD = GlobalDecl(D);
951 GetAddrOfGlobal(GD), Int8PtrTy));
1733 GlobalDecl GD) const {
1734 const auto *D = dyn_cast<NamedDecl>(GD.getDecl());
1737 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType());
1756 GlobalDecl GD) const {
1757 setDLLImportDLLExport(GV, GD);
1758 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl()));
1829 // Returns true if GD is a function decl with internal linkage and
1831 static bool isUniqueInternalLinkageDecl(GlobalDecl GD,
1833 const Decl *D = GD.getDecl();
1835 (CGM.getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage);
1838 static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD,
1848 MC.mangleName(GD.getWithDecl(ND), Out);
1861 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) {
1876 if (ShouldMangle && isUniqueInternalLinkageDecl(GD, CGM)) {
1889 GD.getMultiVersionIndex(), Out);
1911 unsigned Index = GD.getMultiVersionIndex();
1930 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD,
1940 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
1947 "Other GD should now be a multiversioned function");
1967 if (GD.getCanonicalDecl() == OtherGD.getCanonicalDecl())
1975 StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
1976 GlobalDecl CanonicalGD = GD.getCanonicalDecl();
1982 CXXCtorType OrigCtorType = GD.getCtorType();
1993 if (!LangOpts.CUDAIsDevice || !getContext().mayExternalize(GD.getDecl())) {
2000 const auto *ND = cast<NamedDecl>(GD.getDecl());
2001 std::string MangledName = getMangledNameImpl(*this, GD, ND);
2020 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel),
2023 auto Result = Manglings.insert(std::make_pair(MangledName, GD));
2027 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD,
2030 const Decl *D = GD.getDecl();
2038 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out);
2040 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out);
2124 CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
2125 const auto *D = cast<FunctionDecl>(GD.getDecl());
2130 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType());
2160 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD,
2165 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv,
2170 if (const Decl *D = GD.getDecl())
2598 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
2599 const Decl *D = GD.getDecl();
2601 setGVProperties(GV, GD);
2618 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD,
2627 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl());
2637 getContext().getFunctionFeatureMap(FeatureMap, GD);
2663 TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName();
2691 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
2693 const Decl *D = GD.getDecl();
2694 SetCommonAttributes(GD, GO);
2718 if (GetCPUAndFeaturesAttributes(GD, Attrs)) {
2740 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD,
2743 const Decl *D = GD.getDecl();
2744 SetLLVMFunctionAttributes(GD, FI, F, /*IsThunk=*/false);
2749 setNonAliasAttributes(GD, F);
2832 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
2843 const auto *FD = cast<FunctionDecl>(GD.getDecl());
2846 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F,
2852 if (!IsThunk && getCXXABI().HasThisReturn(GD) &&
3566 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) {
3567 StringRef Name = getMangledName(GD);
3579 APValue &V = GD->getAsAPValue();
3584 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType());
3590 MSGuidDecl::Parts Parts = GD->getParts();
3613 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType());
3728 void CodeGenModule::EmitGlobal(GlobalDecl GD) {
3729 const auto *Global = cast<ValueDecl>(GD.getDecl());
3738 return EmitAliasDefinition(GD);
3742 return emitIFuncDefinition(GD);
3746 return emitCPUDispatchDefinition(GD);
3777 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD))
3796 StringRef MangledName = getMangledName(GD);
3807 StringRef MangledName = getMangledName(GD);
3810 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
3813 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false,
3865 EmitGlobalDefinition(GD);
3866 addEmittedDeferredDecl(GD);
3878 StringRef MangledName = getMangledName(GD);
3881 addDeferredDeclToEmit(GD);
3885 addDeferredDeclToEmit(GD);
3890 DeferredDecls[MangledName] = GD;
4023 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
4024 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage)
4027 const auto *F = cast<FunctionDecl>(GD.getDecl());
4090 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD,
4092 const auto *FD = cast<FunctionDecl>(GD.getDecl());
4097 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr);
4103 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr);
4105 GetOrCreateMultiVersionResolver(GD);
4107 EmitGlobalFunctionDefinition(GD, GV);
4112 AddDeferredMultiVersionResolverToEmit(GD);
4115 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) {
4116 const auto *D = cast<ValueDecl>(GD.getDecl());
4125 if (!shouldEmitFunction(GD))
4140 ABI->emitCXXStructor(GD);
4142 EmitMultiVersionFunctionDefinition(GD, GV);
4144 EmitGlobalFunctionDefinition(GD, GV);
4147 getVTables().EmitThunks(GD);
4153 return EmitMultiVersionFunctionDefinition(GD, GV);
4154 return EmitGlobalFunctionDefinition(GD, GV);
4191 GlobalDecl GD) {
4192 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl());
4201 for (GlobalDecl GD : MVFuncsToEmit) {
4202 const auto *FD = cast<FunctionDecl>(GD.getDecl());
4273 llvm::Constant *ResolverConstant = GetOrCreateMultiVersionResolver(GD);
4279 *this, GD, FD, /*OmitMultiVersionMangling=*/true);
4281 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
4287 DeclTy, 0, getMultiversionLinkage(*this, GD),
4295 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD));
4331 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) {
4332 const auto *FD = cast<FunctionDecl>(GD.getDecl());
4338 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
4341 StringRef ResolverName = getMangledName(GD);
4342 UpdateMultiVersionNames(GD, FD, ResolverName);
4354 ResolverGD = GD;
4359 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD));
4369 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) +
4382 ExistingDecl = GD.getWithMultiVersionIndex(Index);
4429 llvm::GlobalValue::LinkageTypes Linkage = getMultiversionLinkage(*this, GD);
4430 auto *IFunc = cast<llvm::GlobalValue>(GetOrCreateMultiVersionResolver(GD));
4442 *this, GD, FD, /*OmitMultiVersionMangling=*/true);
4447 SetCommonAttributes(GD, GA);
4453 void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) {
4454 const auto *FD = cast<FunctionDecl>(GD.getDecl());
4459 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
4463 MultiVersionFuncs.push_back(GD);
4469 llvm::Constant *CodeGenModule::GetOrCreateMultiVersionResolver(GlobalDecl GD) {
4470 const auto *FD = cast<FunctionDecl>(GD.getDecl());
4474 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
4507 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
4513 AddDeferredMultiVersionResolverToEmit(GD);
4526 llvm::GlobalIFunc::create(DeclTy, 0, getMultiversionLinkage(*this, GD),
4566 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable,
4569 const Decl *D = GD.getDecl();
4577 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() &&
4582 GDDef = GlobalDecl(CD, GD.getCtorType());
4584 GDDef = GlobalDecl(DD, GD.getDtorType());
4592 UpdateMultiVersionNames(GD, FD, MangledName);
4599 AddDeferredMultiVersionResolverToEmit(GD);
4601 *this, GD, FD, /*OmitMultiVersionMangling=*/true);
4603 return GetOrCreateMultiVersionResolver(GD);
4630 // Check that GD is not yet in DiagnosedConflictingDefinitions is required
4633 (GD.getCanonicalDecl().getDecl() !=
4635 DiagnosedConflictingDefinitions.insert(GD).second) {
4702 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk);
4714 GD.getDtorType()))
4715 addDeferredDeclToEmit(GD);
4745 addDeferredDeclToEmit(GD.getWithDecl(FD));
4766 CodeGenModule::GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty, bool ForVTable,
4771 const auto *FD = cast<FunctionDecl>(GD.getDecl());
4778 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) {
4780 GD.getDtorType() == Dtor_Complete &&
4782 GD = GlobalDecl(DD, Dtor_Base);
4785 StringRef MangledName = getMangledName(GD);
4786 auto *F = GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer,
4791 cast<FunctionDecl>(GD.getDecl())->hasAttr<CUDAGlobalAttr>()) {
4793 cast<llvm::Function>(F->stripPointerCasts()), GD);
5100 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) {
5101 const Decl *D = GD.getDecl();
5104 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr,
5111 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
5116 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
5118 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
5968 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
5970 const auto *D = cast<FunctionDecl>(GD.getDecl());
5973 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
5978 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false,
5991 setFunctionLinkage(GD, Fn);
5994 setGVProperties(Fn, GD);
6000 CodeGenFunction(*this).GenerateCode(GD, Fn, FI);
6002 setNonAliasAttributes(GD, Fn);
6013 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
6014 const auto *D = cast<ValueDecl>(GD.getDecl());
6018 StringRef MangledName = getMangledName(GD);
6031 Aliases.push_back(GD);
6040 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD,
6042 LT = getFunctionLinkage(GD);
6046 if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl()))
6049 LT = getFunctionLinkage(GD);
6092 SetCommonAttributes(GD, GA);
6097 DI->EmitGlobalAlias(cast<llvm::GlobalValue>(GA->getAliasee()->stripPointerCasts()), GD);
6100 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {
6101 const auto *D = cast<ValueDecl>(GD.getDecl());
6105 StringRef MangledName = getMangledName(GD);
6117 DiagnosedConflictingDefinitions.insert(GD).second) {
6126 Aliases.push_back(GD);
6159 SetCommonAttributes(GD, GIF);
7227 GlobalDecl GD(cast<FunctionDecl>(D));
7228 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
7229 getFunctionLinkage(GD));
7234 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base);
7235 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
7236 getFunctionLinkage(GD));
7241 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base);
7242 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
7243 getFunctionLinkage(GD));
7431 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D));
7432 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV);