Lines Matching defs:FD

447   for (const FieldDecl *FD : StructDecl->fields()) {
448 const Type *Ty = FD->getType()->getUnqualifiedDesugaredType();
450 createFieldForHostLayoutStruct(S, Ty, FD->getIdentifier(), LS))
485 if (FieldDecl *FD =
488 LS->addDecl(FD);
579 void SemaHLSL::ActOnTopLevelFunction(FunctionDecl *FD) {
582 if (FD->getName() != TargetInfo.getTargetOpts().HLSLEntry)
587 if (const auto *Shader = FD->getAttr<HLSLShaderAttr>()) {
593 FD->setInvalidDecl();
598 FD->addAttr(HLSLShaderAttr::CreateImplicit(getASTContext(), Env,
599 FD->getBeginLoc()));
612 void SemaHLSL::CheckEntryPoint(FunctionDecl *FD) {
613 const auto *ShaderAttr = FD->getAttr<HLSLShaderAttr>();
630 if (const auto *NT = FD->getAttr<HLSLNumThreadsAttr>()) {
635 FD->setInvalidDecl();
637 if (const auto *WS = FD->getAttr<HLSLWaveSizeAttr>()) {
642 FD->setInvalidDecl();
649 if (!FD->hasAttr<HLSLNumThreadsAttr>()) {
650 Diag(FD->getLocation(), diag::err_hlsl_missing_numthreads)
652 FD->setInvalidDecl();
654 if (const auto *WS = FD->getAttr<HLSLWaveSizeAttr>()) {
658 FD->setInvalidDecl();
664 FD->setInvalidDecl();
672 for (ParmVarDecl *Param : FD->parameters()) {
674 CheckSemanticAnnotation(FD, Param, AnnotationAttr);
678 Diag(FD->getLocation(), diag::err_hlsl_missing_semantic_annotation);
680 FD->setInvalidDecl();
1329 for (FieldDecl *FD : RD->fields()) {
1330 const Type *Ty = FD->getType()->getUnqualifiedDesugaredType();
1654 void AddToScannedFunctions(const FunctionDecl *FD) {
1655 unsigned &ScannedStages = ScannedDecls[FD];
1659 unsigned GetScannedStages(const FunctionDecl *FD) { return ScannedDecls[FD]; }
1661 bool WasAlreadyScannedInCurrentStage(const FunctionDecl *FD) {
1662 return WasAlreadyScannedInCurrentStage(GetScannedStages(FD));
1674 void HandleFunctionOrMethodRef(FunctionDecl *FD, Expr *RefExpr);
1688 void RunOnFunction(const FunctionDecl *FD);
1691 FunctionDecl *FD = llvm::dyn_cast<FunctionDecl>(DRE->getDecl());
1692 if (FD)
1693 HandleFunctionOrMethodRef(FD, DRE);
1698 FunctionDecl *FD = llvm::dyn_cast<FunctionDecl>(ME->getMemberDecl());
1699 if (FD)
1700 HandleFunctionOrMethodRef(FD, ME);
1705 void DiagnoseHLSLAvailability::HandleFunctionOrMethodRef(FunctionDecl *FD,
1712 if (FD->hasBody(FDWithBody)) {
1719 const AvailabilityAttr *AA = FindAvailabilityAttr(FD);
1722 FD, AA, SourceRange(RefExpr->getBeginLoc(), RefExpr->getEndLoc()));
1751 const FunctionDecl *FD = llvm::dyn_cast<FunctionDecl>(D);
1752 if (!FD || !FD->isThisDeclarationADefinition())
1756 if (HLSLShaderAttr *ShaderAttr = FD->getAttr<HLSLShaderAttr>()) {
1758 RunOnFunction(FD);
1764 bool isExport = FD->isInExportDeclContext();
1766 for (const auto *Redecl : FD->redecls()) {
1775 RunOnFunction(FD);
1782 void DiagnoseHLSLAvailability::RunOnFunction(const FunctionDecl *FD) {
1784 DeclsToScan.push_back(FD);
1791 const FunctionDecl *FD = DeclsToScan.pop_back_val();
1794 const unsigned ScannedStages = GetScannedStages(FD);
1800 AddToScannedFunctions(FD);
1801 TraverseStmt(FD->getBody());
2596 for (const auto *FD : RD->fields())
2597 FieldTypes.push_back(FD->getType());