Lines Matching full:gd
380 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
381 const auto *D = cast<ValueDecl>(GD.getDecl()); in checkAliases()
389 StringRef MangledName = getMangledName(GD); in checkAliases()
436 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
437 StringRef MangledName = getMangledName(GD); in checkAliases()
613 GlobalDecl GD; in Release() local
615 GD = GlobalDecl(FD, KernelReferenceKind::Kernel); in Release()
617 GD = GlobalDecl(D); in Release()
619 GetAddrOfGlobal(GD), Int8PtrTy)); in Release()
1248 GlobalDecl GD) const { in setDLLImportDLLExport()
1249 const auto *D = dyn_cast<NamedDecl>(GD.getDecl()); in setDLLImportDLLExport()
1252 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType()); in setDLLImportDLLExport()
1271 GlobalDecl GD) const { in setGVProperties()
1272 setDLLImportDLLExport(GV, GD); in setGVProperties()
1273 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl())); in setGVProperties()
1390 // Returns true if GD is a function decl with internal linkage and
1392 static bool isUniqueInternalLinkageDecl(GlobalDecl GD, in isUniqueInternalLinkageDecl() argument
1394 const Decl *D = GD.getDecl(); in isUniqueInternalLinkageDecl()
1396 (CGM.getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage); in isUniqueInternalLinkageDecl()
1426 static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD, in getMangledNameImpl() argument
1436 MC.mangleName(GD.getWithDecl(ND), Out); in getMangledNameImpl()
1446 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) { in getMangledNameImpl()
1461 if (ShouldMangle && isUniqueInternalLinkageDecl(GD, CGM)) { in getMangledNameImpl()
1474 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1484 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1500 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD, in UpdateMultiVersionNames() argument
1510 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in UpdateMultiVersionNames()
1517 "Other GD should now be a multiversioned function"); in UpdateMultiVersionNames()
1537 if (GD.getCanonicalDecl() == OtherGD.getCanonicalDecl()) in UpdateMultiVersionNames()
1545 StringRef CodeGenModule::getMangledName(GlobalDecl GD) { in getMangledName() argument
1546 GlobalDecl CanonicalGD = GD.getCanonicalDecl(); in getMangledName()
1552 CXXCtorType OrigCtorType = GD.getCtorType(); in getMangledName()
1563 if (!LangOpts.CUDAIsDevice || !getContext().mayExternalize(GD.getDecl())) { in getMangledName()
1570 const auto *ND = cast<NamedDecl>(GD.getDecl()); in getMangledName()
1571 std::string MangledName = getMangledNameImpl(*this, GD, ND); in getMangledName()
1590 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel), in getMangledName()
1593 auto Result = Manglings.insert(std::make_pair(MangledName, GD)); in getMangledName()
1597 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD, in getBlockMangledName() argument
1600 const Decl *D = GD.getDecl(); in getBlockMangledName()
1608 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out); in getBlockMangledName()
1610 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out); in getBlockMangledName()
1694 CodeGenModule::getFunctionLinkage(GlobalDecl GD) { in getFunctionLinkage() argument
1695 const auto *D = cast<FunctionDecl>(GD.getDecl()); in getFunctionLinkage()
1700 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); in getFunctionLinkage()
1735 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD, in SetLLVMFunctionAttributes() argument
1740 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv, in SetLLVMFunctionAttributes()
2174 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) { in SetCommonAttributes() argument
2175 const Decl *D = GD.getDecl(); in SetCommonAttributes()
2177 setGVProperties(GV, GD); in SetCommonAttributes()
2192 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD, in GetCPUAndFeaturesAttributes() argument
2200 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl()); in GetCPUAndFeaturesAttributes()
2210 getContext().getFunctionFeatureMap(FeatureMap, GD); in GetCPUAndFeaturesAttributes()
2237 SD->getCPUName(GD.getMultiVersionIndex())->getName()); in GetCPUAndFeaturesAttributes()
2262 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, in setNonAliasAttributes() argument
2264 const Decl *D = GD.getDecl(); in setNonAliasAttributes()
2265 SetCommonAttributes(GD, GO); in setNonAliasAttributes()
2289 if (GetCPUAndFeaturesAttributes(GD, Attrs)) { in setNonAliasAttributes()
2311 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD, in SetInternalFunctionAttributes() argument
2314 const Decl *D = GD.getDecl(); in SetInternalFunctionAttributes()
2315 SetLLVMFunctionAttributes(GD, FI, F, /*IsThunk=*/false); in SetInternalFunctionAttributes()
2320 setNonAliasAttributes(GD, F); in SetInternalFunctionAttributes()
2406 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, in SetFunctionAttributes() argument
2417 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in SetFunctionAttributes()
2420 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F, in SetFunctionAttributes()
2426 if (!IsThunk && getCXXABI().HasThisReturn(GD) && in SetFunctionAttributes()
3125 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) { in GetAddrOfMSGuidDecl() argument
3126 StringRef Name = getMangledName(GD); in GetAddrOfMSGuidDecl()
3138 APValue &V = GD->getAsAPValue(); in GetAddrOfMSGuidDecl()
3143 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType()); in GetAddrOfMSGuidDecl()
3149 MSGuidDecl::Parts Parts = GD->getParts(); in GetAddrOfMSGuidDecl()
3172 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType()); in GetAddrOfMSGuidDecl()
3267 void CodeGenModule::EmitGlobal(GlobalDecl GD) { in EmitGlobal() argument
3268 const auto *Global = cast<ValueDecl>(GD.getDecl()); in EmitGlobal()
3277 return EmitAliasDefinition(GD); in EmitGlobal()
3281 return emitIFuncDefinition(GD); in EmitGlobal()
3285 return emitCPUDispatchDefinition(GD); in EmitGlobal()
3315 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) in EmitGlobal()
3335 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3338 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobal()
3341 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false, in EmitGlobal()
3386 EmitGlobalDefinition(GD); in EmitGlobal()
3398 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3401 addDeferredDeclToEmit(GD); in EmitGlobal()
3405 addDeferredDeclToEmit(GD); in EmitGlobal()
3406 EmittedDeferredDecls[MangledName] = GD; in EmitGlobal()
3411 DeferredDecls[MangledName] = GD; in EmitGlobal()
3544 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { in shouldEmitFunction() argument
3545 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) in shouldEmitFunction()
3547 const auto *F = cast<FunctionDecl>(GD.getDecl()); in shouldEmitFunction()
3588 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD, in EmitMultiVersionFunctionDefinition() argument
3590 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in EmitMultiVersionFunctionDefinition()
3595 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
3600 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
3602 GetOrCreateMultiVersionResolver(GD); in EmitMultiVersionFunctionDefinition()
3604 EmitGlobalFunctionDefinition(GD, GV); in EmitMultiVersionFunctionDefinition()
3607 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) { in EmitGlobalDefinition() argument
3608 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitGlobalDefinition()
3617 if (!shouldEmitFunction(GD)) in EmitGlobalDefinition()
3632 ABI->emitCXXStructor(GD); in EmitGlobalDefinition()
3634 EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3636 EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3639 getVTables().EmitThunks(GD); in EmitGlobalDefinition()
3645 return EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3646 return EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3683 GlobalDecl GD) { in getMultiversionLinkage() argument
3684 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); in getMultiversionLinkage()
3693 for (GlobalDecl GD : MVFuncsToEmit) { in emitMultiVersionFunctions() local
3694 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitMultiVersionFunctions()
3700 FD, [this, &GD, &Options](const FunctionDecl *CurFD) { in emitMultiVersionFunctions()
3711 getTypes().arrangeGlobalDeclaration(GD); in emitMultiVersionFunctions()
3781 llvm::Constant *ResolverConstant = GetOrCreateMultiVersionResolver(GD); in emitMultiVersionFunctions()
3786 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD)); in emitMultiVersionFunctions()
3814 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { in emitCPUDispatchDefinition() argument
3815 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitCPUDispatchDefinition()
3821 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in emitCPUDispatchDefinition()
3824 StringRef ResolverName = getMangledName(GD); in emitCPUDispatchDefinition()
3825 UpdateMultiVersionNames(GD, FD, ResolverName); in emitCPUDispatchDefinition()
3837 ResolverGD = GD; in emitCPUDispatchDefinition()
3842 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD)); in emitCPUDispatchDefinition()
3852 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) + in emitCPUDispatchDefinition()
3865 ExistingDecl = GD.getWithMultiVersionIndex(Index); in emitCPUDispatchDefinition()
3911 llvm::GlobalValue::LinkageTypes Linkage = getMultiversionLinkage(*this, GD); in emitCPUDispatchDefinition()
3912 auto *IFunc = cast<llvm::GlobalValue>(GetOrCreateMultiVersionResolver(GD)); in emitCPUDispatchDefinition()
3927 *this, GD, FD, /*OmitMultiVersionMangling=*/true); in emitCPUDispatchDefinition()
3932 SetCommonAttributes(GD, GA); in emitCPUDispatchDefinition()
3939 llvm::Constant *CodeGenModule::GetOrCreateMultiVersionResolver(GlobalDecl GD) { in GetOrCreateMultiVersionResolver() argument
3940 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetOrCreateMultiVersionResolver()
3944 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in GetOrCreateMultiVersionResolver()
3958 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetOrCreateMultiVersionResolver()
3964 MultiVersionFuncs.push_back(GD); in GetOrCreateMultiVersionResolver()
3977 llvm::GlobalIFunc::create(DeclTy, 0, getMultiversionLinkage(*this, GD), in GetOrCreateMultiVersionResolver()
4001 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, in GetOrCreateLLVMFunction() argument
4004 const Decl *D = GD.getDecl(); in GetOrCreateLLVMFunction()
4011 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() && in GetOrCreateLLVMFunction()
4016 GDDef = GlobalDecl(CD, GD.getCtorType()); in GetOrCreateLLVMFunction()
4018 GDDef = GlobalDecl(DD, GD.getDtorType()); in GetOrCreateLLVMFunction()
4026 UpdateMultiVersionNames(GD, FD, MangledName); in GetOrCreateLLVMFunction()
4028 return GetOrCreateMultiVersionResolver(GD); in GetOrCreateLLVMFunction()
4052 // Check that GD is not yet in DiagnosedConflictingDefinitions is required in GetOrCreateLLVMFunction()
4055 (GD.getCanonicalDecl().getDecl() != in GetOrCreateLLVMFunction()
4057 DiagnosedConflictingDefinitions.insert(GD).second) { in GetOrCreateLLVMFunction()
4122 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk); in GetOrCreateLLVMFunction()
4134 GD.getDtorType())) in GetOrCreateLLVMFunction()
4135 addDeferredDeclToEmit(GD); in GetOrCreateLLVMFunction()
4166 addDeferredDeclToEmit(GD.getWithDecl(FD)); in GetOrCreateLLVMFunction()
4187 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, in GetAddrOfFunction() argument
4192 assert(!cast<FunctionDecl>(GD.getDecl())->isConsteval() && in GetAddrOfFunction()
4196 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetAddrOfFunction()
4203 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) { in GetAddrOfFunction()
4205 GD.getDtorType() == Dtor_Complete && in GetAddrOfFunction()
4207 GD = GlobalDecl(DD, Dtor_Base); in GetAddrOfFunction()
4210 StringRef MangledName = getMangledName(GD); in GetAddrOfFunction()
4211 auto *F = GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer, in GetAddrOfFunction()
4216 cast<FunctionDecl>(GD.getDecl())->hasAttr<CUDAGlobalAttr>()) { in GetAddrOfFunction()
4218 cast<llvm::Function>(F->stripPointerCasts()), GD); in GetAddrOfFunction()
4542 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) { in GetAddrOfGlobal() argument
4543 const Decl *D = GD.getDecl(); in GetAddrOfGlobal()
4546 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr, in GetAddrOfGlobal()
4553 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
4558 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetAddrOfGlobal()
4560 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
5367 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, in EmitGlobalFunctionDefinition() argument
5369 const auto *D = cast<FunctionDecl>(GD.getDecl()); in EmitGlobalFunctionDefinition()
5372 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobalFunctionDefinition()
5377 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, in EmitGlobalFunctionDefinition()
5390 setFunctionLinkage(GD, Fn); in EmitGlobalFunctionDefinition()
5393 setGVProperties(Fn, GD); in EmitGlobalFunctionDefinition()
5402 CodeGenFunction(*this).GenerateCode(GD, Fn, FI); in EmitGlobalFunctionDefinition()
5404 setNonAliasAttributes(GD, Fn); in EmitGlobalFunctionDefinition()
5415 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { in EmitAliasDefinition() argument
5416 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitAliasDefinition()
5420 StringRef MangledName = getMangledName(GD); in EmitAliasDefinition()
5433 Aliases.push_back(GD); in EmitAliasDefinition()
5442 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD, in EmitAliasDefinition()
5444 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
5448 if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl())) in EmitAliasDefinition()
5451 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
5495 SetCommonAttributes(GD, GA); in EmitAliasDefinition()
5500 DI->EmitGlobalAlias(cast<llvm::GlobalValue>(GA->getAliasee()->stripPointerCasts()), GD); in EmitAliasDefinition()
5503 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { in emitIFuncDefinition() argument
5504 const auto *D = cast<ValueDecl>(GD.getDecl()); in emitIFuncDefinition()
5508 StringRef MangledName = getMangledName(GD); in emitIFuncDefinition()
5520 DiagnosedConflictingDefinitions.insert(GD).second) { in emitIFuncDefinition()
5529 Aliases.push_back(GD); in emitIFuncDefinition()
5561 SetCommonAttributes(GD, GIF); in emitIFuncDefinition()
6641 GlobalDecl GD(cast<FunctionDecl>(D)); in EmitDeferredUnusedCoverageMappings() local
6642 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6643 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6648 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base); in EmitDeferredUnusedCoverageMappings() local
6649 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6650 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6655 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base); in EmitDeferredUnusedCoverageMappings() local
6656 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6657 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6845 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D)); in EmitDeclMetadata() local
6846 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV); in EmitDeclMetadata()