Lines Matching refs:GD
299 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
300 const auto *D = cast<ValueDecl>(GD.getDecl()); in checkAliases()
307 StringRef MangledName = getMangledName(GD); in checkAliases()
359 for (const GlobalDecl &GD : Aliases) { in checkAliases() local
360 StringRef MangledName = getMangledName(GD); in checkAliases()
817 GlobalDecl GD) const { in setDLLImportDLLExport()
818 const auto *D = dyn_cast<NamedDecl>(GD.getDecl()); in setDLLImportDLLExport()
821 getCXXABI().setCXXDestructorDLLStorage(GV, Dtor, GD.getDtorType()); in setDLLImportDLLExport()
838 GlobalDecl GD) const { in setGVProperties()
839 setDLLImportDLLExport(GV, GD); in setGVProperties()
840 setGlobalVisibilityAndLocal(GV, dyn_cast<NamedDecl>(GD.getDecl())); in setGVProperties()
942 static std::string getMangledNameImpl(const CodeGenModule &CGM, GlobalDecl GD, in getMangledNameImpl() argument
951 MC.mangleCXXCtor(D, GD.getCtorType(), Out); in getMangledNameImpl()
953 MC.mangleCXXDtor(D, GD.getDtorType(), Out); in getMangledNameImpl()
977 GD.getMultiVersionIndex(), Out); in getMangledNameImpl()
990 void CodeGenModule::UpdateMultiVersionNames(GlobalDecl GD, in UpdateMultiVersionNames() argument
999 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in UpdateMultiVersionNames()
1030 StringRef CodeGenModule::getMangledName(GlobalDecl GD) { in getMangledName() argument
1031 GlobalDecl CanonicalGD = GD.getCanonicalDecl(); in getMangledName()
1037 CXXCtorType OrigCtorType = GD.getCtorType(); in getMangledName()
1049 const auto *ND = cast<NamedDecl>(GD.getDecl()); in getMangledName()
1051 Manglings.insert(std::make_pair(getMangledNameImpl(*this, GD, ND), GD)); in getMangledName()
1055 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD, in getBlockMangledName() argument
1058 const Decl *D = GD.getDecl(); in getBlockMangledName()
1066 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out); in getBlockMangledName()
1068 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out); in getBlockMangledName()
1139 CodeGenModule::getFunctionLinkage(GlobalDecl GD) { in getFunctionLinkage() argument
1140 const auto *D = cast<FunctionDecl>(GD.getDecl()); in getFunctionLinkage()
1145 return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); in getFunctionLinkage()
1166 void CodeGenModule::SetLLVMFunctionAttributes(GlobalDecl GD, in SetLLVMFunctionAttributes() argument
1171 ConstructAttributeList(F->getName(), Info, GD, PAL, CallingConv, false); in SetLLVMFunctionAttributes()
1375 void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) { in SetCommonAttributes() argument
1376 const Decl *D = GD.getDecl(); in SetCommonAttributes()
1378 setGVProperties(GV, GD); in SetCommonAttributes()
1393 bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD, in GetCPUAndFeaturesAttributes() argument
1400 const auto *FD = dyn_cast_or_null<FunctionDecl>(GD.getDecl()); in GetCPUAndFeaturesAttributes()
1407 getFunctionFeatureMap(FeatureMap, GD); in GetCPUAndFeaturesAttributes()
1442 void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, in setNonAliasAttributes() argument
1444 const Decl *D = GD.getDecl(); in setNonAliasAttributes()
1445 SetCommonAttributes(GD, GO); in setNonAliasAttributes()
1463 if (GetCPUAndFeaturesAttributes(GD, Attrs)) { in setNonAliasAttributes()
1482 void CodeGenModule::SetInternalFunctionAttributes(GlobalDecl GD, in SetInternalFunctionAttributes() argument
1485 const Decl *D = GD.getDecl(); in SetInternalFunctionAttributes()
1486 SetLLVMFunctionAttributes(GD, FI, F); in SetInternalFunctionAttributes()
1491 setNonAliasAttributes(GD, F); in SetInternalFunctionAttributes()
1534 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, in SetFunctionAttributes() argument
1545 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in SetFunctionAttributes()
1548 SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F); in SetFunctionAttributes()
1557 if (!IsThunk && getCXXABI().HasThisReturn(GD) && in SetFunctionAttributes()
2123 void CodeGenModule::EmitGlobal(GlobalDecl GD) { in EmitGlobal() argument
2124 const auto *Global = cast<ValueDecl>(GD.getDecl()); in EmitGlobal()
2133 return EmitAliasDefinition(GD); in EmitGlobal()
2137 return emitIFuncDefinition(GD); in EmitGlobal()
2141 return emitCPUDispatchDefinition(GD); in EmitGlobal()
2170 if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) in EmitGlobal()
2186 StringRef MangledName = getMangledName(GD); in EmitGlobal()
2189 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobal()
2192 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false, in EmitGlobal()
2229 EmitGlobalDefinition(GD); in EmitGlobal()
2241 StringRef MangledName = getMangledName(GD); in EmitGlobal()
2244 addDeferredDeclToEmit(GD); in EmitGlobal()
2248 addDeferredDeclToEmit(GD); in EmitGlobal()
2253 DeferredDecls[MangledName] = GD; in EmitGlobal()
2385 bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { in shouldEmitFunction() argument
2386 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) in shouldEmitFunction()
2388 const auto *F = cast<FunctionDecl>(GD.getDecl()); in shouldEmitFunction()
2424 void CodeGenModule::EmitMultiVersionFunctionDefinition(GlobalDecl GD, in EmitMultiVersionFunctionDefinition() argument
2426 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in EmitMultiVersionFunctionDefinition()
2431 EmitGlobalFunctionDefinition(GD.getWithMultiVersionIndex(I), nullptr); in EmitMultiVersionFunctionDefinition()
2434 EmitGlobalFunctionDefinition(GD, GV); in EmitMultiVersionFunctionDefinition()
2437 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) { in EmitGlobalDefinition() argument
2438 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitGlobalDefinition()
2447 if (!shouldEmitFunction(GD)) in EmitGlobalDefinition()
2454 ABI->emitCXXStructor(CD, getFromCtorType(GD.getCtorType())); in EmitGlobalDefinition()
2456 ABI->emitCXXStructor(DD, getFromDtorType(GD.getDtorType())); in EmitGlobalDefinition()
2458 EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
2460 EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
2463 getVTables().EmitThunks(GD); in EmitGlobalDefinition()
2469 return EmitMultiVersionFunctionDefinition(GD, GV); in EmitGlobalDefinition()
2470 return EmitGlobalFunctionDefinition(GD, GV); in EmitGlobalDefinition()
2496 for (GlobalDecl GD : MultiVersionFuncs) { in emitMultiVersionFunctions() local
2498 const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); in emitMultiVersionFunctions()
2500 FD, [this, &GD, &Options](const FunctionDecl *CurFD) { in emitMultiVersionFunctions()
2511 getTypes().arrangeGlobalDeclaration(GD); in emitMultiVersionFunctions()
2532 GetGlobalValue((getMangledName(GD) + ".resolver").str())); in emitMultiVersionFunctions()
2534 ResolverFunc = cast<llvm::Function>(GetGlobalValue(getMangledName(GD))); in emitMultiVersionFunctions()
2551 void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { in emitCPUDispatchDefinition() argument
2552 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in emitCPUDispatchDefinition()
2564 StringRef ResolverName = getMangledName(GD); in emitCPUDispatchDefinition()
2575 ResolverGD = GD; in emitCPUDispatchDefinition()
2586 std::string MangledName = getMangledNameImpl(*this, GD, FD, true) + in emitCPUDispatchDefinition()
2599 ExistingDecl = GD.getWithMultiVersionIndex(Index); in emitCPUDispatchDefinition()
2649 GlobalDecl GD, llvm::Type *DeclTy, const FunctionDecl *FD) { in GetOrCreateMultiVersionResolver() argument
2651 getMangledNameImpl(*this, GD, FD, /*OmitMultiVersionMangling=*/true); in GetOrCreateMultiVersionResolver()
2669 MultiVersionFuncs.push_back(GD); in GetOrCreateMultiVersionResolver()
2703 StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, in GetOrCreateLLVMFunction() argument
2706 const Decl *D = GD.getDecl(); in GetOrCreateLLVMFunction()
2713 !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() && in GetOrCreateLLVMFunction()
2718 GDDef = GlobalDecl(CD, GD.getCtorType()); in GetOrCreateLLVMFunction()
2720 GDDef = GlobalDecl(DD, GD.getDtorType()); in GetOrCreateLLVMFunction()
2730 UpdateMultiVersionNames(GD, FD); in GetOrCreateLLVMFunction()
2732 return GetOrCreateMultiVersionResolver(GD, Ty, FD); in GetOrCreateLLVMFunction()
2758 (GD.getCanonicalDecl().getDecl() != in GetOrCreateLLVMFunction()
2760 DiagnosedConflictingDefinitions.insert(GD).second) { in GetOrCreateLLVMFunction()
2824 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk); in GetOrCreateLLVMFunction()
2836 GD.getDtorType())) in GetOrCreateLLVMFunction()
2837 addDeferredDeclToEmit(GD); in GetOrCreateLLVMFunction()
2867 addDeferredDeclToEmit(GD.getWithDecl(FD)); in GetOrCreateLLVMFunction()
2888 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, in GetAddrOfFunction() argument
2895 const auto *FD = cast<FunctionDecl>(GD.getDecl()); in GetAddrOfFunction()
2903 if (const auto *DD = dyn_cast<CXXDestructorDecl>(GD.getDecl())) { in GetAddrOfFunction()
2905 GD.getDtorType() == Dtor_Complete && in GetAddrOfFunction()
2907 GD = GlobalDecl(DD, Dtor_Base); in GetAddrOfFunction()
2910 StringRef MangledName = getMangledName(GD); in GetAddrOfFunction()
2911 return GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer, in GetAddrOfFunction()
3206 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD, in GetAddrOfGlobal() argument
3208 const Decl *D = GD.getDecl(); in GetAddrOfGlobal()
3211 getFromCtorType(GD.getCtorType()), in GetAddrOfGlobal()
3216 getFromDtorType(GD.getDtorType()), in GetAddrOfGlobal()
3223 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
3226 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in GetAddrOfGlobal()
3228 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false, in GetAddrOfGlobal()
3987 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, in EmitGlobalFunctionDefinition() argument
3989 const auto *D = cast<FunctionDecl>(GD.getDecl()); in EmitGlobalFunctionDefinition()
3992 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); in EmitGlobalFunctionDefinition()
3997 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, in EmitGlobalFunctionDefinition()
4010 setFunctionLinkage(GD, Fn); in EmitGlobalFunctionDefinition()
4013 setGVProperties(Fn, GD); in EmitGlobalFunctionDefinition()
4022 setNonAliasAttributes(GD, Fn); in EmitGlobalFunctionDefinition()
4033 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { in EmitAliasDefinition() argument
4034 const auto *D = cast<ValueDecl>(GD.getDecl()); in EmitAliasDefinition()
4038 StringRef MangledName = getMangledName(GD); in EmitAliasDefinition()
4051 Aliases.push_back(GD); in EmitAliasDefinition()
4059 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD, in EmitAliasDefinition()
4106 SetCommonAttributes(GD, GA); in EmitAliasDefinition()
4109 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { in emitIFuncDefinition() argument
4110 const auto *D = cast<ValueDecl>(GD.getDecl()); in emitIFuncDefinition()
4114 StringRef MangledName = getMangledName(GD); in emitIFuncDefinition()
4126 DiagnosedConflictingDefinitions.insert(GD).second) { in emitIFuncDefinition()
4135 Aliases.push_back(GD); in emitIFuncDefinition()
4139 GetOrCreateLLVMFunction(IFA->getResolver(), DeclTy, GD, in emitIFuncDefinition()
4166 SetCommonAttributes(GD, GIF); in emitIFuncDefinition()
5108 GlobalDecl GD(cast<FunctionDecl>(D)); in EmitDeferredUnusedCoverageMappings() local
5109 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
5110 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
5115 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base); in EmitDeferredUnusedCoverageMappings() local
5116 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
5117 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
5122 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base); in EmitDeferredUnusedCoverageMappings() local
5123 PGO.emitEmptyCounterMapping(D, getMangledName(GD), in EmitDeferredUnusedCoverageMappings()
5124 getFunctionLinkage(GD)); in EmitDeferredUnusedCoverageMappings()
5221 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D)); in EmitDeclMetadata() local
5222 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV); in EmitDeclMetadata()
5462 GlobalDecl GD) { in getFunctionFeatureMap() argument
5464 const FunctionDecl *FD = GD.getDecl()->getAsFunction(); in getFunctionFeatureMap()
5487 SD->getCPUName(GD.getMultiVersionIndex())->getName(), FeaturesTmp); in getFunctionFeatureMap()