Lines Matching refs:GD
392 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
393 const auto *D = cast<ValueDecl>(GD.getDecl()); in checkAliases()
401 StringRef MangledName = getMangledName(GD); in checkAliases()
448 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
449 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()
1227 GlobalDecl GD) const { in setDLLImportDLLExport()
1228 const auto *D = dyn_cast<NamedDecl>(GD.getDecl()); in setDLLImportDLLExport()
1231 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType()); in setDLLImportDLLExport()
1250 GlobalDecl GD) const { in setGVProperties()
1251 setDLLImportDLLExport(GV, GD); in setGVProperties()
1252 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl())); in setGVProperties()
1357 static bool isUniqueInternalLinkageDecl(GlobalDecl GD, in isUniqueInternalLinkageDecl() argument
1359 const Decl *D = GD.getDecl(); in isUniqueInternalLinkageDecl()
1361 (CGM.getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage); in isUniqueInternalLinkageDecl()
1378 static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD, in getMangledNameImpl() argument
1388 MC.mangleName(GD.getWithDecl(ND), Out); in getMangledNameImpl()
1398 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) { in getMangledNameImpl()
1413 if (ShouldMangle && isUniqueInternalLinkageDecl(GD, CGM)) { in getMangledNameImpl()
1426 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1433 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1449 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD, in UpdateMultiVersionNames() argument
1459 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in UpdateMultiVersionNames()
1486 if (GD.getCanonicalDecl() == OtherGD.getCanonicalDecl()) in UpdateMultiVersionNames()
1494 StringRef CodeGenModule::getMangledName(GlobalDecl GD) { in getMangledName() argument
1495 GlobalDecl CanonicalGD = GD.getCanonicalDecl(); in getMangledName()
1501 CXXCtorType OrigCtorType = GD.getCtorType(); in getMangledName()
1512 if (!LangOpts.CUDAIsDevice || !getContext().mayExternalize(GD.getDecl())) { in getMangledName()
1519 const auto *ND = cast<NamedDecl>(GD.getDecl()); in getMangledName()
1520 std::string MangledName = getMangledNameImpl(*this, GD, ND); in getMangledName()
1539 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel), in getMangledName()
1542 auto Result = Manglings.insert(std::make_pair(MangledName, GD)); in getMangledName()
1546 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD, in getBlockMangledName() argument
1549 const Decl *D = GD.getDecl(); in getBlockMangledName()
1557 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out); in getBlockMangledName()
1559 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out); in getBlockMangledName()
1642 CodeGenModule::getFunctionLinkage(GlobalDecl GD) { in getFunctionLinkage() argument
1643 const auto *D = cast<FunctionDecl>(GD.getDecl()); in getFunctionLinkage()
1648 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); in getFunctionLinkage()
1669 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD, in SetLLVMFunctionAttributes() argument
1674 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv, in SetLLVMFunctionAttributes()
2105 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) { in SetCommonAttributes() argument
2106 const Decl *D = GD.getDecl(); in SetCommonAttributes()
2108 setGVProperties(GV, GD); in SetCommonAttributes()
2123 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD, in GetCPUAndFeaturesAttributes() argument
2131 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl()); in GetCPUAndFeaturesAttributes()
2139 getContext().getFunctionFeatureMap(FeatureMap, GD); in GetCPUAndFeaturesAttributes()
2165 SD->getCPUName(GD.getMultiVersionIndex())->getName()); in GetCPUAndFeaturesAttributes()
2190 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, in setNonAliasAttributes() argument
2192 const Decl *D = GD.getDecl(); in setNonAliasAttributes()
2193 SetCommonAttributes(GD, GO); in setNonAliasAttributes()
2217 if (GetCPUAndFeaturesAttributes(GD, Attrs)) { in setNonAliasAttributes()
2239 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD, in SetInternalFunctionAttributes() argument
2242 const Decl *D = GD.getDecl(); in SetInternalFunctionAttributes()
2243 SetLLVMFunctionAttributes(GD, FI, F, /*IsThunk=*/false); in SetInternalFunctionAttributes()
2248 setNonAliasAttributes(GD, F); in SetInternalFunctionAttributes()
2283 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, in SetFunctionAttributes() argument
2294 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in SetFunctionAttributes()
2297 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F, in SetFunctionAttributes()
2303 if (!IsThunk && getCXXABI().HasThisReturn(GD) && in SetFunctionAttributes()
2997 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) { in GetAddrOfMSGuidDecl() argument
2998 StringRef Name = getMangledName(GD); in GetAddrOfMSGuidDecl()
3010 APValue &V = GD->getAsAPValue(); in GetAddrOfMSGuidDecl()
3015 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType()); in GetAddrOfMSGuidDecl()
3021 MSGuidDecl::Parts Parts = GD->getParts(); in GetAddrOfMSGuidDecl()
3044 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType()); in GetAddrOfMSGuidDecl()
3139 void CodeGenModule::EmitGlobal(GlobalDecl GD) { in EmitGlobal() argument
3140 const auto *Global = cast<ValueDecl>(GD.getDecl()); in EmitGlobal()
3149 return EmitAliasDefinition(GD); in EmitGlobal()
3153 return emitIFuncDefinition(GD); in EmitGlobal()
3157 return emitCPUDispatchDefinition(GD); in EmitGlobal()
3187 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) in EmitGlobal()
3207 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3210 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobal()
3213 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false, in EmitGlobal()
3256 EmitGlobalDefinition(GD); in EmitGlobal()
3268 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3271 addDeferredDeclToEmit(GD); in EmitGlobal()
3275 addDeferredDeclToEmit(GD); in EmitGlobal()
3280 DeferredDecls[MangledName] = GD; in EmitGlobal()
3413 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { in shouldEmitFunction() argument
3414 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) in shouldEmitFunction()
3416 const auto *F = cast<FunctionDecl>(GD.getDecl()); in shouldEmitFunction()
3457 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD, in EmitMultiVersionFunctionDefinition() argument
3459 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in EmitMultiVersionFunctionDefinition()
3464 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
3469 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
3471 GetOrCreateMultiVersionResolver(GD); in EmitMultiVersionFunctionDefinition()
3473 EmitGlobalFunctionDefinition(GD, GV); in EmitMultiVersionFunctionDefinition()
3476 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) { in EmitGlobalDefinition() argument
3477 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitGlobalDefinition()
3486 if (!shouldEmitFunction(GD)) in EmitGlobalDefinition()
3501 ABI->emitCXXStructor(GD); in EmitGlobalDefinition()
3503 EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3505 EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3508 getVTables().EmitThunks(GD); in EmitGlobalDefinition()
3514 return EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3515 return EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3546 GlobalDecl GD) { in getMultiversionLinkage() argument
3547 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); in getMultiversionLinkage()
3556 for (GlobalDecl GD : MVFuncsToEmit) { in emitMultiVersionFunctions() local
3557 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitMultiVersionFunctions()
3563 FD, [this, &GD, &Options](const FunctionDecl *CurFD) { in emitMultiVersionFunctions()
3574 getTypes().arrangeGlobalDeclaration(GD); in emitMultiVersionFunctions()
3629 llvm::Constant *ResolverConstant = GetOrCreateMultiVersionResolver(GD); in emitMultiVersionFunctions()
3634 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD)); in emitMultiVersionFunctions()
3662 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { in emitCPUDispatchDefinition() argument
3663 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitCPUDispatchDefinition()
3669 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in emitCPUDispatchDefinition()
3672 StringRef ResolverName = getMangledName(GD); in emitCPUDispatchDefinition()
3673 UpdateMultiVersionNames(GD, FD, ResolverName); in emitCPUDispatchDefinition()
3685 ResolverGD = GD; in emitCPUDispatchDefinition()
3690 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD)); in emitCPUDispatchDefinition()
3700 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) + in emitCPUDispatchDefinition()
3713 ExistingDecl = GD.getWithMultiVersionIndex(Index); in emitCPUDispatchDefinition()
3759 llvm::GlobalValue::LinkageTypes Linkage = getMultiversionLinkage(*this, GD); in emitCPUDispatchDefinition()
3760 auto *IFunc = cast<llvm::GlobalValue>(GetOrCreateMultiVersionResolver(GD)); in emitCPUDispatchDefinition()
3775 *this, GD, FD, /*OmitMultiVersionMangling=*/true); in emitCPUDispatchDefinition()
3780 SetCommonAttributes(GD, GA); in emitCPUDispatchDefinition()
3787 llvm::Constant *CodeGenModule::GetOrCreateMultiVersionResolver(GlobalDecl GD) { in GetOrCreateMultiVersionResolver() argument
3788 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetOrCreateMultiVersionResolver()
3792 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in GetOrCreateMultiVersionResolver()
3806 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetOrCreateMultiVersionResolver()
3812 MultiVersionFuncs.push_back(GD); in GetOrCreateMultiVersionResolver()
3825 llvm::GlobalIFunc::create(DeclTy, 0, getMultiversionLinkage(*this, GD), in GetOrCreateMultiVersionResolver()
3849 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, in GetOrCreateLLVMFunction() argument
3852 const Decl *D = GD.getDecl(); in GetOrCreateLLVMFunction()
3859 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() && in GetOrCreateLLVMFunction()
3864 GDDef = GlobalDecl(CD, GD.getCtorType()); in GetOrCreateLLVMFunction()
3866 GDDef = GlobalDecl(DD, GD.getDtorType()); in GetOrCreateLLVMFunction()
3874 UpdateMultiVersionNames(GD, FD, MangledName); in GetOrCreateLLVMFunction()
3876 return GetOrCreateMultiVersionResolver(GD); in GetOrCreateLLVMFunction()
3903 (GD.getCanonicalDecl().getDecl() != in GetOrCreateLLVMFunction()
3905 DiagnosedConflictingDefinitions.insert(GD).second) { in GetOrCreateLLVMFunction()
3969 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk); in GetOrCreateLLVMFunction()
3981 GD.getDtorType())) in GetOrCreateLLVMFunction()
3982 addDeferredDeclToEmit(GD); in GetOrCreateLLVMFunction()
4012 addDeferredDeclToEmit(GD.getWithDecl(FD)); in GetOrCreateLLVMFunction()
4033 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, in GetAddrOfFunction() argument
4038 assert(!cast<FunctionDecl>(GD.getDecl())->isConsteval() && in GetAddrOfFunction()
4042 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetAddrOfFunction()
4049 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) { in GetAddrOfFunction()
4051 GD.getDtorType() == Dtor_Complete && in GetAddrOfFunction()
4053 GD = GlobalDecl(DD, Dtor_Base); in GetAddrOfFunction()
4056 StringRef MangledName = getMangledName(GD); in GetAddrOfFunction()
4057 auto *F = GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer, in GetAddrOfFunction()
4062 cast<FunctionDecl>(GD.getDecl())->hasAttr<CUDAGlobalAttr>()) { in GetAddrOfFunction()
4064 cast<llvm::Function>(F->stripPointerCasts()), GD); in GetAddrOfFunction()
4386 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) { in GetAddrOfGlobal() argument
4387 const Decl *D = GD.getDecl(); in GetAddrOfGlobal()
4390 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr, in GetAddrOfGlobal()
4397 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
4402 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetAddrOfGlobal()
4404 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
5203 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, in EmitGlobalFunctionDefinition() argument
5205 const auto *D = cast<FunctionDecl>(GD.getDecl()); in EmitGlobalFunctionDefinition()
5208 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobalFunctionDefinition()
5213 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, in EmitGlobalFunctionDefinition()
5226 setFunctionLinkage(GD, Fn); in EmitGlobalFunctionDefinition()
5229 setGVProperties(Fn, GD); in EmitGlobalFunctionDefinition()
5238 CodeGenFunction(*this).GenerateCode(GD, Fn, FI); in EmitGlobalFunctionDefinition()
5240 setNonAliasAttributes(GD, Fn); in EmitGlobalFunctionDefinition()
5251 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { in EmitAliasDefinition() argument
5252 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitAliasDefinition()
5256 StringRef MangledName = getMangledName(GD); in EmitAliasDefinition()
5269 Aliases.push_back(GD); in EmitAliasDefinition()
5278 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD, in EmitAliasDefinition()
5280 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
5284 if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl())) in EmitAliasDefinition()
5287 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
5331 SetCommonAttributes(GD, GA); in EmitAliasDefinition()
5336 DI->EmitGlobalAlias(cast<llvm::GlobalValue>(GA->getAliasee()), GD); in EmitAliasDefinition()
5339 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { in emitIFuncDefinition() argument
5340 const auto *D = cast<ValueDecl>(GD.getDecl()); in emitIFuncDefinition()
5344 StringRef MangledName = getMangledName(GD); in emitIFuncDefinition()
5356 DiagnosedConflictingDefinitions.insert(GD).second) { in emitIFuncDefinition()
5365 Aliases.push_back(GD); in emitIFuncDefinition()
5397 SetCommonAttributes(GD, GIF); in emitIFuncDefinition()
6433 GlobalDecl GD(cast<FunctionDecl>(D)); in EmitDeferredUnusedCoverageMappings() local
6434 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6435 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6440 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base); in EmitDeferredUnusedCoverageMappings() local
6441 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6442 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6447 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base); in EmitDeferredUnusedCoverageMappings() local
6448 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6449 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6637 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D)); in EmitDeclMetadata() local
6638 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV); in EmitDeclMetadata()