Lines Matching refs:GD
634 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
635 const auto *D = cast<ValueDecl>(GD.getDecl()); in checkAliases()
645 StringRef MangledName = getMangledName(GD); in checkAliases()
693 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
694 StringRef MangledName = getMangledName(GD); in checkAliases()
905 GlobalDecl GD; in Release() local
907 GD = GlobalDecl(FD, KernelReferenceKind::Kernel); in Release()
909 GD = GlobalDecl(D); in Release()
911 GetAddrOfGlobal(GD), Int8PtrTy)); in Release()
1634 GlobalDecl GD) const { in setDLLImportDLLExport()
1635 const auto *D = dyn_cast<NamedDecl>(GD.getDecl()); in setDLLImportDLLExport()
1638 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType()); in setDLLImportDLLExport()
1657 GlobalDecl GD) const { in setGVProperties()
1658 setDLLImportDLLExport(GV, GD); in setGVProperties()
1659 setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl())); in setGVProperties()
1785 static bool isUniqueInternalLinkageDecl(GlobalDecl GD, in isUniqueInternalLinkageDecl() argument
1787 const Decl *D = GD.getDecl(); in isUniqueInternalLinkageDecl()
1789 (CGM.getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage); in isUniqueInternalLinkageDecl()
1827 static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD, in getMangledNameImpl() argument
1837 MC.mangleName(GD.getWithDecl(ND), Out); in getMangledNameImpl()
1850 GD.getKernelReferenceKind() == KernelReferenceKind::Stub) { in getMangledNameImpl()
1865 if (ShouldMangle && isUniqueInternalLinkageDecl(GD, CGM)) { in getMangledNameImpl()
1878 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1888 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
1904 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD, in UpdateMultiVersionNames() argument
1914 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in UpdateMultiVersionNames()
1941 if (GD.getCanonicalDecl() == OtherGD.getCanonicalDecl()) in UpdateMultiVersionNames()
1949 StringRef CodeGenModule::getMangledName(GlobalDecl GD) { in getMangledName() argument
1950 GlobalDecl CanonicalGD = GD.getCanonicalDecl(); in getMangledName()
1956 CXXCtorType OrigCtorType = GD.getCtorType(); in getMangledName()
1967 if (!LangOpts.CUDAIsDevice || !getContext().mayExternalize(GD.getDecl())) { in getMangledName()
1974 const auto *ND = cast<NamedDecl>(GD.getDecl()); in getMangledName()
1975 std::string MangledName = getMangledNameImpl(*this, GD, ND); in getMangledName()
1994 GD.getWithKernelReferenceKind(KernelReferenceKind::Kernel), in getMangledName()
1997 auto Result = Manglings.insert(std::make_pair(MangledName, GD)); in getMangledName()
2001 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD, in getBlockMangledName() argument
2004 const Decl *D = GD.getDecl(); in getBlockMangledName()
2012 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out); in getBlockMangledName()
2014 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out); in getBlockMangledName()
2098 CodeGenModule::getFunctionLinkage(GlobalDecl GD) { in getFunctionLinkage() argument
2099 const auto *D = cast<FunctionDecl>(GD.getDecl()); in getFunctionLinkage()
2104 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); in getFunctionLinkage()
2134 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD, in SetLLVMFunctionAttributes() argument
2139 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv, in SetLLVMFunctionAttributes()
2564 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) { in SetCommonAttributes() argument
2565 const Decl *D = GD.getDecl(); in SetCommonAttributes()
2567 setGVProperties(GV, GD); in SetCommonAttributes()
2584 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD, in GetCPUAndFeaturesAttributes() argument
2593 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl()); in GetCPUAndFeaturesAttributes()
2603 getContext().getFunctionFeatureMap(FeatureMap, GD); in GetCPUAndFeaturesAttributes()
2629 TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName(); in GetCPUAndFeaturesAttributes()
2657 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, in setNonAliasAttributes() argument
2659 const Decl *D = GD.getDecl(); in setNonAliasAttributes()
2660 SetCommonAttributes(GD, GO); in setNonAliasAttributes()
2684 if (GetCPUAndFeaturesAttributes(GD, Attrs)) { in setNonAliasAttributes()
2706 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD, in SetInternalFunctionAttributes() argument
2709 const Decl *D = GD.getDecl(); in SetInternalFunctionAttributes()
2710 SetLLVMFunctionAttributes(GD, FI, F, /*IsThunk=*/false); in SetInternalFunctionAttributes()
2715 setNonAliasAttributes(GD, F); in SetInternalFunctionAttributes()
2798 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, in SetFunctionAttributes() argument
2809 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in SetFunctionAttributes()
2812 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F, in SetFunctionAttributes()
2818 if (!IsThunk && getCXXABI().HasThisReturn(GD) && in SetFunctionAttributes()
3529 ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl(const MSGuidDecl *GD) { in GetAddrOfMSGuidDecl() argument
3530 StringRef Name = getMangledName(GD); in GetAddrOfMSGuidDecl()
3542 APValue &V = GD->getAsAPValue(); in GetAddrOfMSGuidDecl()
3547 GD->getAsAPValue(), GD->getType().getAddressSpace(), GD->getType()); in GetAddrOfMSGuidDecl()
3553 MSGuidDecl::Parts Parts = GD->getParts(); in GetAddrOfMSGuidDecl()
3576 llvm::Type *Ty = getTypes().ConvertTypeForMem(GD->getType()); in GetAddrOfMSGuidDecl()
3678 void CodeGenModule::EmitGlobal(GlobalDecl GD) { in EmitGlobal() argument
3679 const auto *Global = cast<ValueDecl>(GD.getDecl()); in EmitGlobal()
3688 return EmitAliasDefinition(GD); in EmitGlobal()
3692 return emitIFuncDefinition(GD); in EmitGlobal()
3696 return emitCPUDispatchDefinition(GD); in EmitGlobal()
3736 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) in EmitGlobal()
3755 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3765 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3768 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobal()
3771 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false, in EmitGlobal()
3823 EmitGlobalDefinition(GD); in EmitGlobal()
3824 addEmittedDeferredDecl(GD); in EmitGlobal()
3836 StringRef MangledName = getMangledName(GD); in EmitGlobal()
3839 addDeferredDeclToEmit(GD); in EmitGlobal()
3843 addDeferredDeclToEmit(GD); in EmitGlobal()
3848 DeferredDecls[MangledName] = GD; in EmitGlobal()
3981 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { in shouldEmitFunction() argument
3982 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) in shouldEmitFunction()
3985 const auto *F = cast<FunctionDecl>(GD.getDecl()); in shouldEmitFunction()
4037 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD, in EmitMultiVersionFunctionDefinition() argument
4039 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in EmitMultiVersionFunctionDefinition()
4044 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
4049 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
4051 GetOrCreateMultiVersionResolver(GD); in EmitMultiVersionFunctionDefinition()
4053 GetOrCreateMultiVersionResolver(GD); in EmitMultiVersionFunctionDefinition()
4055 EmitGlobalFunctionDefinition(GD, GV); in EmitMultiVersionFunctionDefinition()
4058 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) { in EmitGlobalDefinition() argument
4059 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitGlobalDefinition()
4068 if (!shouldEmitFunction(GD)) in EmitGlobalDefinition()
4083 ABI->emitCXXStructor(GD); in EmitGlobalDefinition()
4085 EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
4087 EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
4090 getVTables().EmitThunks(GD); in EmitGlobalDefinition()
4096 return EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
4097 return EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
4134 GlobalDecl GD) { in getMultiversionLinkage() argument
4135 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); in getMultiversionLinkage()
4144 for (GlobalDecl GD : MVFuncsToEmit) { in emitMultiVersionFunctions() local
4145 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitMultiVersionFunctions()
4151 FD, [this, &GD, &Options](const FunctionDecl *CurFD) { in emitMultiVersionFunctions()
4162 getTypes().arrangeGlobalDeclaration(GD); in emitMultiVersionFunctions()
4232 llvm::Constant *ResolverConstant = GetOrCreateMultiVersionResolver(GD); in emitMultiVersionFunctions()
4236 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in emitMultiVersionFunctions()
4239 *this, GD, FD, /*OmitMultiVersionMangling=*/true); in emitMultiVersionFunctions()
4244 DeclTy, 0, getMultiversionLinkage(*this, GD), in emitMultiVersionFunctions()
4251 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD)); in emitMultiVersionFunctions()
4279 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { in emitCPUDispatchDefinition() argument
4280 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitCPUDispatchDefinition()
4286 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in emitCPUDispatchDefinition()
4289 StringRef ResolverName = getMangledName(GD); in emitCPUDispatchDefinition()
4290 UpdateMultiVersionNames(GD, FD, ResolverName); in emitCPUDispatchDefinition()
4302 ResolverGD = GD; in emitCPUDispatchDefinition()
4307 ResolverFunc->setLinkage(getMultiversionLinkage(*this, GD)); in emitCPUDispatchDefinition()
4317 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) + in emitCPUDispatchDefinition()
4330 ExistingDecl = GD.getWithMultiVersionIndex(Index); in emitCPUDispatchDefinition()
4377 llvm::GlobalValue::LinkageTypes Linkage = getMultiversionLinkage(*this, GD); in emitCPUDispatchDefinition()
4378 auto *IFunc = cast<llvm::GlobalValue>(GetOrCreateMultiVersionResolver(GD)); in emitCPUDispatchDefinition()
4393 *this, GD, FD, /*OmitMultiVersionMangling=*/true); in emitCPUDispatchDefinition()
4398 SetCommonAttributes(GD, GA); in emitCPUDispatchDefinition()
4405 llvm::Constant *CodeGenModule::GetOrCreateMultiVersionResolver(GlobalDecl GD) { in GetOrCreateMultiVersionResolver() argument
4406 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetOrCreateMultiVersionResolver()
4410 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in GetOrCreateMultiVersionResolver()
4426 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetOrCreateMultiVersionResolver()
4432 MultiVersionFuncs.push_back(GD); in GetOrCreateMultiVersionResolver()
4445 llvm::GlobalIFunc::create(DeclTy, 0, getMultiversionLinkage(*this, GD), in GetOrCreateMultiVersionResolver()
4469 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, in GetOrCreateLLVMFunction() argument
4472 const Decl *D = GD.getDecl(); in GetOrCreateLLVMFunction()
4479 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() && in GetOrCreateLLVMFunction()
4484 GDDef = GlobalDecl(CD, GD.getCtorType()); in GetOrCreateLLVMFunction()
4486 GDDef = GlobalDecl(DD, GD.getDtorType()); in GetOrCreateLLVMFunction()
4494 UpdateMultiVersionNames(GD, FD, MangledName); in GetOrCreateLLVMFunction()
4496 return GetOrCreateMultiVersionResolver(GD); in GetOrCreateLLVMFunction()
4523 (GD.getCanonicalDecl().getDecl() != in GetOrCreateLLVMFunction()
4525 DiagnosedConflictingDefinitions.insert(GD).second) { in GetOrCreateLLVMFunction()
4592 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk); in GetOrCreateLLVMFunction()
4604 GD.getDtorType())) in GetOrCreateLLVMFunction()
4605 addDeferredDeclToEmit(GD); in GetOrCreateLLVMFunction()
4635 addDeferredDeclToEmit(GD.getWithDecl(FD)); in GetOrCreateLLVMFunction()
4656 CodeGenModule::GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty, bool ForVTable, in GetAddrOfFunction() argument
4661 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetAddrOfFunction()
4668 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) { in GetAddrOfFunction()
4670 GD.getDtorType() == Dtor_Complete && in GetAddrOfFunction()
4672 GD = GlobalDecl(DD, Dtor_Base); in GetAddrOfFunction()
4675 StringRef MangledName = getMangledName(GD); in GetAddrOfFunction()
4676 auto *F = GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer, in GetAddrOfFunction()
4681 cast<FunctionDecl>(GD.getDecl())->hasAttr<CUDAGlobalAttr>()) { in GetAddrOfFunction()
4683 cast<llvm::Function>(F->stripPointerCasts()), GD); in GetAddrOfFunction()
4987 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition) { in GetAddrOfGlobal() argument
4988 const Decl *D = GD.getDecl(); in GetAddrOfGlobal()
4991 return getAddrOfCXXStructor(GD, /*FnInfo=*/nullptr, /*FnType=*/nullptr, in GetAddrOfGlobal()
4998 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
5003 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetAddrOfGlobal()
5005 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
5816 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, in EmitGlobalFunctionDefinition() argument
5818 const auto *D = cast<FunctionDecl>(GD.getDecl()); in EmitGlobalFunctionDefinition()
5821 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobalFunctionDefinition()
5826 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, in EmitGlobalFunctionDefinition()
5839 setFunctionLinkage(GD, Fn); in EmitGlobalFunctionDefinition()
5842 setGVProperties(Fn, GD); in EmitGlobalFunctionDefinition()
5848 CodeGenFunction(*this).GenerateCode(GD, Fn, FI); in EmitGlobalFunctionDefinition()
5850 setNonAliasAttributes(GD, Fn); in EmitGlobalFunctionDefinition()
5861 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { in EmitAliasDefinition() argument
5862 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitAliasDefinition()
5866 StringRef MangledName = getMangledName(GD); in EmitAliasDefinition()
5879 Aliases.push_back(GD); in EmitAliasDefinition()
5888 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD, in EmitAliasDefinition()
5890 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
5894 if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl())) in EmitAliasDefinition()
5897 LT = getFunctionLinkage(GD); in EmitAliasDefinition()
5940 SetCommonAttributes(GD, GA); in EmitAliasDefinition()
5945 DI->EmitGlobalAlias(cast<llvm::GlobalValue>(GA->getAliasee()->stripPointerCasts()), GD); in EmitAliasDefinition()
5948 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { in emitIFuncDefinition() argument
5949 const auto *D = cast<ValueDecl>(GD.getDecl()); in emitIFuncDefinition()
5953 StringRef MangledName = getMangledName(GD); in emitIFuncDefinition()
5965 DiagnosedConflictingDefinitions.insert(GD).second) { in emitIFuncDefinition()
5974 Aliases.push_back(GD); in emitIFuncDefinition()
6007 SetCommonAttributes(GD, GIF); in emitIFuncDefinition()
7078 GlobalDecl GD(cast<FunctionDecl>(D)); in EmitDeferredUnusedCoverageMappings() local
7079 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
7080 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
7085 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base); in EmitDeferredUnusedCoverageMappings() local
7086 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
7087 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
7092 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base); in EmitDeferredUnusedCoverageMappings() local
7093 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
7094 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
7282 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D)); in EmitDeclMetadata() local
7283 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV); in EmitDeclMetadata()