• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/CodeGen/

Lines Matching refs:GD

306   for (const GlobalDecl &GD : Aliases) {
307 const auto *D = cast<ValueDecl>(GD.getDecl());
314 StringRef MangledName = getMangledName(GD);
366 for (const GlobalDecl &GD : Aliases) {
367 StringRef MangledName = getMangledName(GD);
919 GlobalDecl GD) const {
920 const auto *D = dyn_cast<NamedDecl>(GD.getDecl());
923 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType());
940 GlobalDecl GD) const {
941 setDLLImportDLLExport(GV, GD);
942 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl()));
1045 static std::string getMangledNameImpl(const CodeGenModule &CGM, GlobalDecl GD,
1052 MC.mangleName(GD.getWithDecl(ND), Out);
1062 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) {
1076 GD.getMultiVersionIndex(), Out);
1089 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD,
1098 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
1105 "Other GD should now be a multiversioned function");
1129 StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
1130 GlobalDecl CanonicalGD = GD.getCanonicalDecl();
1136 CXXCtorType OrigCtorType = GD.getCtorType();
1148 const auto *ND = cast<NamedDecl>(GD.getDecl());
1149 std::string MangledName = getMangledNameImpl(*this, GD, ND);
1168 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel),
1171 auto Result = Manglings.insert(std::make_pair(MangledName, GD));
1175 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD,
1178 const Decl *D = GD.getDecl();
1186 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out);
1188 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out);
1259 CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
1260 const auto *D = cast<FunctionDecl>(GD.getDecl());
1265 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType());
1286 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD,
1291 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv, false);
1711 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) {
1712 const Decl *D = GD.getDecl();
1714 setGVProperties(GV, GD);
1729 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD,
1736 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl());
1743 getContext().getFunctionFeatureMap(FeatureMap, GD);
1778 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
1780 const Decl *D = GD.getDecl();
1781 SetCommonAttributes(GD, GO);
1801 if (GetCPUAndFeaturesAttributes(GD, Attrs)) {
1820 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD,
1823 const Decl *D = GD.getDecl();
1824 SetLLVMFunctionAttributes(GD, FI, F);
1829 setNonAliasAttributes(GD, F);
1864 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
1875 const auto *FD = cast<FunctionDecl>(GD.getDecl());
1878 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F);
1883 if (!IsThunk && getCXXABI().HasThisReturn(GD) &&
2440 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) {
2441 StringRef Name = getMangledName(GD);
2453 APValue &V = GD->getAsAPValue();
2458 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType());
2464 MSGuidDecl::Parts Parts = GD->getParts();
2486 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType());
2525 void CodeGenModule::EmitGlobal(GlobalDecl GD) {
2526 const auto *Global = cast<ValueDecl>(GD.getDecl());
2535 return EmitAliasDefinition(GD);
2539 return emitIFuncDefinition(GD);
2543 return emitCPUDispatchDefinition(GD);
2573 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD))
2593 StringRef MangledName = getMangledName(GD);
2596 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
2599 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false,
2642 EmitGlobalDefinition(GD);
2654 StringRef MangledName = getMangledName(GD);
2657 addDeferredDeclToEmit(GD);
2661 addDeferredDeclToEmit(GD);
2666 DeferredDecls[MangledName] = GD;
2799 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
2800 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage)
2802 const auto *F = cast<FunctionDecl>(GD.getDecl());
2838 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD,
2840 const auto *FD = cast<FunctionDecl>(GD.getDecl());
2845 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr);
2848 EmitGlobalFunctionDefinition(GD, GV);
2851 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) {
2852 const auto *D = cast<ValueDecl>(GD.getDecl());
2861 if (!shouldEmitFunction(GD))
2876 ABI->emitCXXStructor(GD);
2878 EmitMultiVersionFunctionDefinition(GD, GV);
2880 EmitGlobalFunctionDefinition(GD, GV);
2883 getVTables().EmitThunks(GD);
2889 return EmitMultiVersionFunctionDefinition(GD, GV);
2890 return EmitGlobalFunctionDefinition(GD, GV);
2916 for (GlobalDecl GD : MultiVersionFuncs) {
2918 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl());
2920 FD, [this, &GD, &Options](const FunctionDecl *CurFD) {
2931 getTypes().arrangeGlobalDeclaration(GD);
2952 GetGlobalValue((getMangledName(GD) + ".resolver").str()));
2955 ResolverFunc = cast<llvm::Function>(GetGlobalValue(getMangledName(GD)));
2972 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) {
2973 const auto *FD = cast<FunctionDecl>(GD.getDecl());
2984 StringRef ResolverName = getMangledName(GD);
2995 ResolverGD = GD;
3010 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) +
3023 ExistingDecl = GD.getWithMultiVersionIndex(Index);
3071 *this, GD, FD, /*OmitMultiVersionMangling=*/true);
3075 AliasName, DeclTy, GD, /*ForVTable=*/false, /*DontDefer=*/true,
3078 DeclTy, 0, getFunctionLinkage(GD), AliasName, IFunc, &getModule());
3080 SetCommonAttributes(GD, GA);
3088 GlobalDecl GD, llvm::Type *DeclTy, const FunctionDecl *FD) {
3090 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true);
3108 MultiVersionFuncs.push_back(GD);
3142 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable,
3145 const Decl *D = GD.getDecl();
3152 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() &&
3157 GDDef = GlobalDecl(CD, GD.getCtorType());
3159 GDDef = GlobalDecl(DD, GD.getDtorType());
3168 UpdateMultiVersionNames(GD, FD);
3170 return GetOrCreateMultiVersionResolver(GD, Ty, FD);
3193 // Check that GD is not yet in DiagnosedConflictingDefinitions is required
3196 (GD.getCanonicalDecl().getDecl() !=
3198 DiagnosedConflictingDefinitions.insert(GD).second) {
3262 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk);
3274 GD.getDtorType()))
3275 addDeferredDeclToEmit(GD);
3305 addDeferredDeclToEmit(GD.getWithDecl(FD));
3326 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD,
3331 assert(!cast<FunctionDecl>(GD.getDecl())->isConsteval() &&
3335 const auto *FD = cast<FunctionDecl>(GD.getDecl());
3342 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) {
3344 GD.getDtorType() == Dtor_Complete &&
3346 GD = GlobalDecl(DD, Dtor_Base);
3349 StringRef MangledName = getMangledName(GD);
3350 return GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer,
3651 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) {
3652 const Decl *D = GD.getDecl();
3655 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr,
3662 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
3667 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
3669 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
4495 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
4497 const auto *D = cast<FunctionDecl>(GD.getDecl());
4500 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
4505 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false,
4518 setFunctionLinkage(GD, Fn);
4521 setGVProperties(Fn, GD);
4528 CodeGenFunction(*this).GenerateCode(GD, Fn, FI);
4530 setNonAliasAttributes(GD, Fn);
4541 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
4542 const auto *D = cast<ValueDecl>(GD.getDecl());
4546 StringRef MangledName = getMangledName(GD);
4559 Aliases.push_back(GD);
4568 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD,
4570 LT = getFunctionLinkage(GD);
4575 LT = getLLVMLinkageVarDefinition(cast<VarDecl>(GD.getDecl()),
4620 SetCommonAttributes(GD, GA);
4623 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {
4624 const auto *D = cast<ValueDecl>(GD.getDecl());
4628 StringRef MangledName = getMangledName(GD);
4640 DiagnosedConflictingDefinitions.insert(GD).second) {
4649 Aliases.push_back(GD);
4653 GetOrCreateLLVMFunction(IFA->getResolver(), DeclTy, GD,
4680 SetCommonAttributes(GD, GIF);
5636 GlobalDecl GD(cast<FunctionDecl>(D));
5637 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
5638 getFunctionLinkage(GD));
5643 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base);
5644 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
5645 getFunctionLinkage(GD));
5650 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base);
5651 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
5652 getFunctionLinkage(GD));
5760 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D));
5761 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV);