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