Lines Matching defs:GD
285 for (const GlobalDecl &GD : Aliases) {
286 const auto *D = cast<ValueDecl>(GD.getDecl());
288 StringRef MangledName = getMangledName(GD);
332 for (const GlobalDecl &GD : Aliases) {
333 StringRef MangledName = getMangledName(GD);
613 StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
614 StringRef &FoundStr = MangledDeclNames[GD.getCanonicalDecl()];
618 const auto *ND = cast<NamedDecl>(GD.getDecl());
624 getCXXABI().getMangleContext().mangleCXXCtor(D, GD.getCtorType(), Out);
626 getCXXABI().getMangleContext().mangleCXXDtor(D, GD.getDtorType(), Out);
637 auto Result = Manglings.insert(std::make_pair(Str, GD));
641 StringRef CodeGenModule::getBlockMangledName(GlobalDecl GD,
644 const Decl *D = GD.getDecl();
652 MangleCtx.mangleCtorBlock(CD, GD.getCtorType(), BD, Out);
654 MangleCtx.mangleDtorBlock(DD, GD.getDtorType(), BD, Out);
712 CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
713 const auto *D = cast<FunctionDecl>(GD.getDecl());
719 GD.getDtorType())) {
729 void CodeGenModule::setFunctionDLLStorageClass(GlobalDecl GD, llvm::Function *F) {
730 const auto *FD = cast<FunctionDecl>(GD.getDecl());
733 if (getCXXABI().useThunkForDtorVariant(Dtor, GD.getDtorType())) {
998 void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
1008 const auto *FD = cast<FunctionDecl>(GD.getDecl());
1011 SetLLVMFunctionAttributes(FD, getTypes().arrangeGlobalDeclaration(GD), F);
1016 if (!IsThunk && getCXXABI().HasThisReturn(GD) &&
1228 GlobalDecl D = G.GD;
1464 void CodeGenModule::EmitGlobal(GlobalDecl GD) {
1465 const auto *Global = cast<ValueDecl>(GD.getDecl());
1474 return EmitAliasDefinition(GD);
1500 StringRef MangledName = getMangledName(GD);
1503 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
1506 GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false,
1524 EmitGlobalDefinition(GD);
1536 StringRef MangledName = getMangledName(GD);
1539 addDeferredDeclToEmit(GV, GD);
1543 addDeferredDeclToEmit(/*GV=*/nullptr, GD);
1548 DeferredDecls[MangledName] = GD;
1637 CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
1638 if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage)
1640 const auto *F = cast<FunctionDecl>(GD.getDecl());
1676 void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) {
1677 const auto *D = cast<ValueDecl>(GD.getDecl());
1686 if (!shouldEmitFunction(GD))
1694 ABI->emitCXXStructor(CD, getFromCtorType(GD.getCtorType()));
1696 ABI->emitCXXStructor(DD, getFromDtorType(GD.getDtorType()));
1698 EmitGlobalFunctionDefinition(GD, GV);
1701 getVTables().EmitThunks(GD);
1706 return EmitGlobalFunctionDefinition(GD, GV);
1728 GlobalDecl GD, bool ForVTable,
1732 GD.getDecl();
1751 // Check that GD is not yet in ExplicitDefinitions is required to make
1754 (GD.getCanonicalDecl().getDecl() !=
1756 DiagnosedConflictingDefinitions.insert(GD).second) {
1820 SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk);
1835 GD.getDtorType()))
1836 addDeferredDeclToEmit(F, GD);
1866 addDeferredDeclToEmit(F, GD.getWithDecl(FD));
1887 llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD,
1894 const auto *FD = cast<FunctionDecl>(GD.getDecl());
1899 StringRef MangledName = getMangledName(GD);
1900 return GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer,
2042 CodeGenModule::GetAddrOfGlobal(GlobalDecl GD,
2044 if (isa<CXXConstructorDecl>(GD.getDecl()))
2045 return getAddrOfCXXStructor(cast<CXXConstructorDecl>(GD.getDecl()),
2046 getFromCtorType(GD.getCtorType()),
2049 else if (isa<CXXDestructorDecl>(GD.getDecl()))
2050 return getAddrOfCXXStructor(cast<CXXDestructorDecl>(GD.getDecl()),
2051 getFromDtorType(GD.getDtorType()),
2054 else if (isa<CXXMethodDecl>(GD.getDecl())) {
2056 cast<CXXMethodDecl>(GD.getDecl()));
2058 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
2060 } else if (isa<FunctionDecl>(GD.getDecl())) {
2061 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
2063 return GetAddrOfFunction(GD, Ty, /*ForVTable=*/false, /*DontDefer=*/false,
2066 return GetAddrOfGlobalVar(cast<VarDecl>(GD.getDecl()));
2683 void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
2685 const auto *D = cast<FunctionDecl>(GD.getDecl());
2688 const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
2693 GV = cast<llvm::GlobalValue>(GetAddrOfFunction(GD, Ty, /*ForVTable=*/false,
2706 setFunctionLinkage(GD, Fn);
2707 setFunctionDLLStorageClass(GD, Fn);
2729 void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
2730 const auto *D = cast<ValueDecl>(GD.getDecl());
2734 StringRef MangledName = getMangledName(GD);
2747 Aliases.push_back(GD);
2755 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD,
3698 GlobalDecl GD(cast<FunctionDecl>(D));
3699 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
3700 getFunctionLinkage(GD));
3705 GlobalDecl GD(cast<CXXConstructorDecl>(D), Ctor_Base);
3706 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
3707 getFunctionLinkage(GD));
3712 GlobalDecl GD(cast<CXXDestructorDecl>(D), Dtor_Base);
3713 PGO.emitEmptyCounterMapping(D, getMangledName(GD),
3714 getFunctionLinkage(GD));
3809 GlobalDecl GD = GlobalDecl(cast<VarDecl>(D));
3810 EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV);