Lines Matching refs:GD

342   for (const GlobalDecl &GD : Aliases) {  in checkAliases()  local
343 const auto *D = cast<ValueDecl>(GD.getDecl()); in checkAliases()
350 StringRef MangledName = getMangledName(GD); in checkAliases()
402 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
403 StringRef MangledName = getMangledName(GD); in checkAliases()
1103 GlobalDecl GD) const { in setDLLImportDLLExport()
1104 const auto *D = dyn_cast<NamedDecl>(GD.getDecl()); in setDLLImportDLLExport()
1107 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType()); in setDLLImportDLLExport()
1124 GlobalDecl GD) const { in setGVProperties()
1125 setDLLImportDLLExport(GV, GD); in setGVProperties()
1126 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl())); in setGVProperties()
1231 static bool isUniqueInternalLinkageDecl(GlobalDecl GD, in isUniqueInternalLinkageDecl() argument
1233 const Decl *D = GD.getDecl(); in isUniqueInternalLinkageDecl()
1235 (CGM.getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage); in isUniqueInternalLinkageDecl()
1238 static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD, in getMangledNameImpl() argument
1248 MC.mangleName(GD.getWithDecl(ND), Out); in getMangledNameImpl()
1258 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) { in getMangledNameImpl()
1273 if (ShouldMangle && isUniqueInternalLinkageDecl(GD, CGM)) { in getMangledNameImpl()
1286 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1304 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD, in UpdateMultiVersionNames() argument
1313 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in UpdateMultiVersionNames()
1344 StringRef CodeGenModule::getMangledName(GlobalDecl GD) { in getMangledName() argument
1345 GlobalDecl CanonicalGD = GD.getCanonicalDecl(); in getMangledName()
1351 CXXCtorType OrigCtorType = GD.getCtorType(); in getMangledName()
1363 !getContext().mayExternalizeStaticVar(GD.getDecl())) { in getMangledName()
1370 const auto *ND = cast<NamedDecl>(GD.getDecl()); in getMangledName()
1371 std::string MangledName = getMangledNameImpl(*this, GD, ND); in getMangledName()
1390 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel), in getMangledName()
1393 auto Result = Manglings.insert(std::make_pair(MangledName, GD)); in getMangledName()
1397 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD, in getBlockMangledName() argument
1400 const Decl *D = GD.getDecl(); in getBlockMangledName()
1408 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out); in getBlockMangledName()
1410 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out); in getBlockMangledName()
1483 CodeGenModule::getFunctionLinkage(GlobalDecl GD) { in getFunctionLinkage() argument
1484 const auto *D = cast<FunctionDecl>(GD.getDecl()); in getFunctionLinkage()
1489 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); in getFunctionLinkage()
1510 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD, in SetLLVMFunctionAttributes() argument
1515 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv, in SetLLVMFunctionAttributes()
1925 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) { in SetCommonAttributes() argument
1926 const Decl *D = GD.getDecl(); in SetCommonAttributes()
1928 setGVProperties(GV, GD); in SetCommonAttributes()
1943 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD, in GetCPUAndFeaturesAttributes() argument
1951 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl()); in GetCPUAndFeaturesAttributes()
1958 getContext().getFunctionFeatureMap(FeatureMap, GD); in GetCPUAndFeaturesAttributes()
2002 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, in setNonAliasAttributes() argument
2004 const Decl *D = GD.getDecl(); in setNonAliasAttributes()
2005 SetCommonAttributes(GD, GO); in setNonAliasAttributes()
2029 if (GetCPUAndFeaturesAttributes(GD, Attrs)) { in setNonAliasAttributes()
2051 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD, in SetInternalFunctionAttributes() argument
2054 const Decl *D = GD.getDecl(); in SetInternalFunctionAttributes()
2055 SetLLVMFunctionAttributes(GD, FI, F, /*IsThunk=*/false); in SetInternalFunctionAttributes()
2060 setNonAliasAttributes(GD, F); in SetInternalFunctionAttributes()
2095 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, in SetFunctionAttributes() argument
2106 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in SetFunctionAttributes()
2109 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F, in SetFunctionAttributes()
2115 if (!IsThunk && getCXXABI().HasThisReturn(GD) && in SetFunctionAttributes()
2755 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) { in GetAddrOfMSGuidDecl() argument
2756 StringRef Name = getMangledName(GD); in GetAddrOfMSGuidDecl()
2768 APValue &V = GD->getAsAPValue(); in GetAddrOfMSGuidDecl()
2773 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType()); in GetAddrOfMSGuidDecl()
2779 MSGuidDecl::Parts Parts = GD->getParts(); in GetAddrOfMSGuidDecl()
2801 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType()); in GetAddrOfMSGuidDecl()
2865 void CodeGenModule::EmitGlobal(GlobalDecl GD) { in EmitGlobal() argument
2866 const auto *Global = cast<ValueDecl>(GD.getDecl()); in EmitGlobal()
2875 return EmitAliasDefinition(GD); in EmitGlobal()
2879 return emitIFuncDefinition(GD); in EmitGlobal()
2883 return emitCPUDispatchDefinition(GD); in EmitGlobal()
2913 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) in EmitGlobal()
2933 StringRef MangledName = getMangledName(GD); in EmitGlobal()
2936 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobal()
2939 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false, in EmitGlobal()
2982 EmitGlobalDefinition(GD); in EmitGlobal()
2994 StringRef MangledName = getMangledName(GD); in EmitGlobal()
2997 addDeferredDeclToEmit(GD); in EmitGlobal()
3001 addDeferredDeclToEmit(GD); in EmitGlobal()
3006 DeferredDecls[MangledName] = GD; in EmitGlobal()
3139 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { in shouldEmitFunction() argument
3140 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) in shouldEmitFunction()
3142 const auto *F = cast<FunctionDecl>(GD.getDecl()); in shouldEmitFunction()
3178 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD, in EmitMultiVersionFunctionDefinition() argument
3180 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in EmitMultiVersionFunctionDefinition()
3185 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
3188 EmitGlobalFunctionDefinition(GD, GV); in EmitMultiVersionFunctionDefinition()
3191 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) { in EmitGlobalDefinition() argument
3192 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitGlobalDefinition()
3201 if (!shouldEmitFunction(GD)) in EmitGlobalDefinition()
3216 ABI->emitCXXStructor(GD); in EmitGlobalDefinition()
3218 EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3220 EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3223 getVTables().EmitThunks(GD); in EmitGlobalDefinition()
3229 return EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3230 return EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
3258 for (GlobalDecl GD : MVFuncsToEmit) { in emitMultiVersionFunctions() local
3260 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); in emitMultiVersionFunctions()
3262 FD, [this, &GD, &Options](const FunctionDecl *CurFD) { in emitMultiVersionFunctions()
3273 getTypes().arrangeGlobalDeclaration(GD); in emitMultiVersionFunctions()
3294 GetGlobalValue((getMangledName(GD) + ".resolver").str())); in emitMultiVersionFunctions()
3297 ResolverFunc = cast<llvm::Function>(GetGlobalValue(getMangledName(GD))); in emitMultiVersionFunctions()
3325 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { in emitCPUDispatchDefinition() argument
3326 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitCPUDispatchDefinition()
3337 StringRef ResolverName = getMangledName(GD); in emitCPUDispatchDefinition()
3348 ResolverGD = GD; in emitCPUDispatchDefinition()
3363 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) + in emitCPUDispatchDefinition()
3376 ExistingDecl = GD.getWithMultiVersionIndex(Index); in emitCPUDispatchDefinition()
3424 *this, GD, FD, /*OmitMultiVersionMangling=*/true); in emitCPUDispatchDefinition()
3428 AliasName, DeclTy, GD, /*ForVTable=*/false, /*DontDefer=*/true, in emitCPUDispatchDefinition()
3431 DeclTy, 0, getFunctionLinkage(GD), AliasName, IFunc, &getModule()); in emitCPUDispatchDefinition()
3433 SetCommonAttributes(GD, GA); in emitCPUDispatchDefinition()
3441 GlobalDecl GD, llvm::Type *DeclTy, const FunctionDecl *FD) { in GetOrCreateMultiVersionResolver() argument
3443 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in GetOrCreateMultiVersionResolver()
3461 MultiVersionFuncs.push_back(GD); in GetOrCreateMultiVersionResolver()
3495 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, in GetOrCreateLLVMFunction() argument
3498 const Decl *D = GD.getDecl(); in GetOrCreateLLVMFunction()
3505 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() && in GetOrCreateLLVMFunction()
3510 GDDef = GlobalDecl(CD, GD.getCtorType()); in GetOrCreateLLVMFunction()
3512 GDDef = GlobalDecl(DD, GD.getDtorType()); in GetOrCreateLLVMFunction()
3521 UpdateMultiVersionNames(GD, FD); in GetOrCreateLLVMFunction()
3523 return GetOrCreateMultiVersionResolver(GD, Ty, FD); in GetOrCreateLLVMFunction()
3549 (GD.getCanonicalDecl().getDecl() != in GetOrCreateLLVMFunction()
3551 DiagnosedConflictingDefinitions.insert(GD).second) { in GetOrCreateLLVMFunction()
3615 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk); in GetOrCreateLLVMFunction()
3627 GD.getDtorType())) in GetOrCreateLLVMFunction()
3628 addDeferredDeclToEmit(GD); in GetOrCreateLLVMFunction()
3658 addDeferredDeclToEmit(GD.getWithDecl(FD)); in GetOrCreateLLVMFunction()
3679 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, in GetAddrOfFunction() argument
3684 assert(!cast<FunctionDecl>(GD.getDecl())->isConsteval() && in GetAddrOfFunction()
3688 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetAddrOfFunction()
3695 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) { in GetAddrOfFunction()
3697 GD.getDtorType() == Dtor_Complete && in GetAddrOfFunction()
3699 GD = GlobalDecl(DD, Dtor_Base); in GetAddrOfFunction()
3702 StringRef MangledName = getMangledName(GD); in GetAddrOfFunction()
3703 auto *F = GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer, in GetAddrOfFunction()
3708 cast<FunctionDecl>(GD.getDecl())->hasAttr<CUDAGlobalAttr>()) { in GetAddrOfFunction()
3710 cast<llvm::Function>(F->stripPointerCasts()), GD); in GetAddrOfFunction()
4021 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) { in GetAddrOfGlobal() argument
4022 const Decl *D = GD.getDecl(); in GetAddrOfGlobal()
4025 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr, in GetAddrOfGlobal()
4032 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
4037 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetAddrOfGlobal()
4039 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
4826 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, in EmitGlobalFunctionDefinition() argument
4828 const auto *D = cast<FunctionDecl>(GD.getDecl()); in EmitGlobalFunctionDefinition()
4831 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobalFunctionDefinition()
4836 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, in EmitGlobalFunctionDefinition()
4849 setFunctionLinkage(GD, Fn); in EmitGlobalFunctionDefinition()
4852 setGVProperties(Fn, GD); in EmitGlobalFunctionDefinition()
4861 CodeGenFunction(*this).GenerateCode(GD, Fn, FI); in EmitGlobalFunctionDefinition()
4863 setNonAliasAttributes(GD, Fn); in EmitGlobalFunctionDefinition()
4874 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { in EmitAliasDefinition() argument
4875 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitAliasDefinition()
4879 StringRef MangledName = getMangledName(GD); in EmitAliasDefinition()
4892 Aliases.push_back(GD); in EmitAliasDefinition()
4901 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD, in EmitAliasDefinition()
4903 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
4907 if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl())) in EmitAliasDefinition()
4910 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
4954 SetCommonAttributes(GD, GA); in EmitAliasDefinition()
4957 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { in emitIFuncDefinition() argument
4958 const auto *D = cast<ValueDecl>(GD.getDecl()); in emitIFuncDefinition()
4962 StringRef MangledName = getMangledName(GD); in emitIFuncDefinition()
4974 DiagnosedConflictingDefinitions.insert(GD).second) { in emitIFuncDefinition()
4983 Aliases.push_back(GD); in emitIFuncDefinition()
4987 GetOrCreateLLVMFunction(IFA->getResolver(), DeclTy, GD, in emitIFuncDefinition()
5014 SetCommonAttributes(GD, GIF); in emitIFuncDefinition()
6027 GlobalDecl GD(cast<FunctionDecl>(D)); in EmitDeferredUnusedCoverageMappings() local
6028 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6029 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6034 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base); in EmitDeferredUnusedCoverageMappings() local
6035 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6036 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6041 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base); in EmitDeferredUnusedCoverageMappings() local
6042 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
6043 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
6151 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D)); in EmitDeclMetadata() local
6152 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV); in EmitDeclMetadata()