Lines Matching refs:gd
237 CIRGenModule::getAddrOfGlobal(GlobalDecl gd, ForDefinition_t isForDefinition) { in getAddrOfGlobal() argument
238 const Decl *d = gd.getDecl(); in getAddrOfGlobal()
241 return getAddrOfCXXStructor(gd, /*FnInfo=*/nullptr, /*FnType=*/nullptr, in getAddrOfGlobal()
248 return getAddrOfFunction(gd, ty, /*ForVTable=*/false, /*DontDefer=*/false, in getAddrOfGlobal()
253 const CIRGenFunctionInfo &fi = getTypes().arrangeGlobalDeclaration(gd); in getAddrOfGlobal()
255 return getAddrOfFunction(gd, ty, /*ForVTable=*/false, /*DontDefer=*/false, in getAddrOfGlobal()
332 void CIRGenModule::emitGlobal(clang::GlobalDecl gd) { in emitGlobal() argument
333 if (const auto *cd = dyn_cast<clang::OpenACCConstructDecl>(gd.getDecl())) { in emitGlobal()
338 const auto *global = cast<ValueDecl>(gd.getDecl()); in emitGlobal()
376 emitGlobalDefinition(gd); in emitGlobal()
384 llvm::StringRef mangledName = getMangledName(gd); in emitGlobal()
387 addDeferredDeclToEmit(gd); in emitGlobal()
391 addDeferredDeclToEmit(gd); in emitGlobal()
395 deferredDecls[mangledName] = gd; in emitGlobal()
399 void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd, in emitGlobalFunctionDefinition() argument
401 auto const *funcDecl = cast<FunctionDecl>(gd.getDecl()); in emitGlobalFunctionDefinition()
402 const CIRGenFunctionInfo &fi = getTypes().arrangeGlobalDeclaration(gd); in emitGlobalFunctionDefinition()
406 funcOp = getAddrOfFunction(gd, funcType, /*ForVTable=*/false, in emitGlobalFunctionDefinition()
414 setFunctionLinkage(gd, funcOp); in emitGlobalFunctionDefinition()
424 cgf.generateCode(gd, funcOp, funcType); in emitGlobalFunctionDefinition()
428 setNonAliasAttributes(gd, funcOp); in emitGlobalFunctionDefinition()
479 void CIRGenModule::setCommonAttributes(GlobalDecl gd, mlir::Operation *gv) { in setCommonAttributes() argument
480 const Decl *d = gd.getDecl(); in setCommonAttributes()
487 void CIRGenModule::setNonAliasAttributes(GlobalDecl gd, mlir::Operation *op) { in setNonAliasAttributes() argument
488 setCommonAttributes(gd, op); in setNonAliasAttributes()
787 void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd, in emitGlobalDefinition() argument
789 const auto *decl = cast<ValueDecl>(gd.getDecl()); in emitGlobalDefinition()
798 abi->emitCXXStructor(gd); in emitGlobalDefinition()
802 emitGlobalFunctionDefinition(gd, op); in emitGlobalDefinition()
812 emitGlobalFunctionDefinition(gd, op); in emitGlobalDefinition()
1113 cir::GlobalLinkageKind CIRGenModule::getFunctionLinkage(GlobalDecl gd) { in getFunctionLinkage() argument
1114 const auto *d = cast<FunctionDecl>(gd.getDecl()); in getFunctionLinkage()
1119 return getCXXABI().getCXXDestructorLinkage(linkage, dtor, gd.getDtorType()); in getFunctionLinkage()
1302 GlobalDecl gd, const CIRGenFunctionInfo *fnInfo, cir::FuncType fnType, in getAddrAndTypeOfCXXStructor() argument
1304 auto *md = cast<CXXMethodDecl>(gd.getDecl()); in getAddrAndTypeOfCXXStructor()
1310 gd.getDtorType() == Dtor_Complete && in getAddrAndTypeOfCXXStructor()
1318 fnInfo = &getTypes().arrangeCXXStructorDeclaration(gd); in getAddrAndTypeOfCXXStructor()
1322 auto fn = getOrCreateCIRFunction(getMangledName(gd), fnType, gd, in getAddrAndTypeOfCXXStructor()
1329 cir::FuncOp CIRGenModule::getAddrOfFunction(clang::GlobalDecl gd, in getAddrOfFunction() argument
1333 assert(!cast<FunctionDecl>(gd.getDecl())->isConsteval() && in getAddrOfFunction()
1337 const auto *fd = cast<FunctionDecl>(gd.getDecl()); in getAddrOfFunction()
1344 if (const auto *dd = dyn_cast<CXXDestructorDecl>(gd.getDecl())) { in getAddrOfFunction()
1346 gd.getDtorType() == Dtor_Complete && in getAddrOfFunction()
1352 StringRef mangledName = getMangledName(gd); in getAddrOfFunction()
1354 getOrCreateCIRFunction(mangledName, funcType, gd, forVTable, dontDefer, in getAddrOfFunction()
1359 static std::string getMangledNameImpl(CIRGenModule &cgm, GlobalDecl gd, in getMangledNameImpl() argument
1369 mc.mangleName(gd.getWithDecl(nd), out); in getMangledNameImpl()
1379 gd.getKernelReferenceKind() == KernelReferenceKind::Stub) { in getMangledNameImpl()
1408 StringRef CIRGenModule::getMangledName(GlobalDecl gd) { in getMangledName() argument
1409 GlobalDecl canonicalGd = gd.getCanonicalDecl(); in getMangledName()
1417 return cast<NamedDecl>(gd.getDecl())->getIdentifier()->getName(); in getMangledName()
1422 const auto *nd = cast<NamedDecl>(gd.getDecl()); in getMangledName()
1423 std::string mangledName = getMangledNameImpl(*this, gd, nd); in getMangledName()
1425 auto result = manglings.insert(std::make_pair(mangledName, gd)); in getMangledName()
1668 StringRef mangledName, mlir::Type funcType, GlobalDecl gd, bool forVTable, in getOrCreateCIRFunction() argument
1671 const Decl *d = gd.getDecl(); in getOrCreateCIRFunction()
1724 auto *funcDecl = llvm::cast_or_null<FunctionDecl>(gd.getDecl()); in getOrCreateCIRFunction()
1733 setFunctionAttributes(gd, funcOp, /*isIncompleteFunction=*/false, isThunk); in getOrCreateCIRFunction()
1748 gd.getDtorType())) in getOrCreateCIRFunction()
1779 addDeferredDeclToEmit(gd.getWithDecl(fd)); in getOrCreateCIRFunction()