Lines Matching defs:AL

513                                                   const AttributeCommonInfo &AL,
517 Diag(NT->getLocation(), diag::err_hlsl_attribute_param_mismatch) << AL;
518 Diag(AL.getLoc(), diag::note_conflicting_attribute);
523 HLSLNumThreadsAttr(getASTContext(), AL, X, Y, Z);
527 const AttributeCommonInfo &AL,
534 Diag(WS->getLocation(), diag::err_hlsl_attribute_param_mismatch) << AL;
535 Diag(AL.getLoc(), diag::note_conflicting_attribute);
540 HLSLWaveSizeAttr(getASTContext(), AL, Min, Max, Preferred);
546 SemaHLSL::mergeShaderAttr(Decl *D, const AttributeCommonInfo &AL,
550 Diag(NT->getLocation(), diag::err_hlsl_attribute_param_mismatch) << AL;
551 Diag(AL.getLoc(), diag::note_conflicting_attribute);
555 return HLSLShaderAttr::Create(getASTContext(), ShaderType, AL);
559 SemaHLSL::mergeParamModifierAttr(Decl *D, const AttributeCommonInfo &AL,
567 SourceRange AdjustedRange = {PA->getLocation(), AL.getRange().getEnd()};
572 Diag(AL.getLoc(), diag::err_hlsl_duplicate_parameter_modifier) << AL;
576 return HLSLParamModifierAttr::Create(getASTContext(), AL);
909 void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) {
923 if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(0), X))
926 Diag(AL.getArgAsExpr(0)->getExprLoc(),
932 if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(1), Y))
935 Diag(AL.getArgAsExpr(1)->getExprLoc(),
941 if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(2), Z))
944 SemaRef.Diag(AL.getArgAsExpr(2)->getExprLoc(),
951 Diag(AL.getLoc(), diag::err_hlsl_numthreads_invalid) << ThreadMax;
955 HLSLNumThreadsAttr *NewAttr = mergeNumThreadsAttr(D, AL, X, Y, Z);
964 void SemaHLSL::handleWaveSizeAttr(Decl *D, const ParsedAttr &AL) {
967 unsigned SpelledArgsCount = AL.getNumArgs();
972 if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(0), Min))
977 !SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(1), Max))
982 !SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(2), Preferred))
987 Diag(AL.getArgAsExpr(2)->getExprLoc(),
989 << AL << llvm::dxil::MinWaveSize << llvm::dxil::MaxWaveSize
995 Diag(AL.getArgAsExpr(2)->getExprLoc(),
997 << AL << Min << Max << Preferred;
1002 Diag(AL.getArgAsExpr(1)->getExprLoc(),
1004 << AL << llvm::dxil::MinWaveSize << llvm::dxil::MaxWaveSize << Max;
1008 Diag(AL.getLoc(), diag::err_attribute_argument_invalid) << AL << 1;
1011 Diag(AL.getLoc(), diag::warn_attr_min_eq_max) << AL;
1015 Diag(AL.getArgAsExpr(0)->getExprLoc(),
1017 << AL << llvm::dxil::MinWaveSize << llvm::dxil::MaxWaveSize << Min;
1023 mergeWaveSizeAttr(D, AL, Min, Max, Preferred, SpelledArgsCount);
1028 bool SemaHLSL::diagnoseInputIDType(QualType T, const ParsedAttr &AL) {
1033 Diag(AL.getLoc(), diag::err_hlsl_attr_invalid_type)
1034 << AL << "uint/uint2/uint3";
1041 void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) {
1043 if (!diagnoseInputIDType(VD->getType(), AL))
1047 HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
1050 void SemaHLSL::handleSV_GroupThreadIDAttr(Decl *D, const ParsedAttr &AL) {
1052 if (!diagnoseInputIDType(VD->getType(), AL))
1056 HLSLSV_GroupThreadIDAttr(getASTContext(), AL));
1059 void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) {
1061 if (!diagnoseInputIDType(VD->getType(), AL))
1064 D->addAttr(::new (getASTContext()) HLSLSV_GroupIDAttr(getASTContext(), AL));
1067 void SemaHLSL::handlePackOffsetAttr(Decl *D, const ParsedAttr &AL) {
1069 Diag(AL.getLoc(), diag::err_hlsl_attr_invalid_ast_node)
1070 << AL << "shader constant in a constant buffer";
1075 if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(0), SubComponent))
1078 if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(1), Component))
1090 Diag(AL.getLoc(), diag::err_hlsl_packoffset_cross_reg_boundary);
1095 Diag(AL.getLoc(), diag::err_hlsl_packoffset_cross_reg_boundary);
1105 Diag(AL.getLoc(), diag::err_hlsl_packoffset_alignment_mismatch)
1113 getASTContext(), AL, SubComponent, Component));
1116 void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) {
1119 if (!SemaRef.checkStringLiteralArgumentAttr(AL, 0, Str, &ArgLoc))
1124 Diag(AL.getLoc(), diag::warn_attribute_type_not_supported)
1125 << AL << Str << ArgLoc;
1131 HLSLShaderAttr *NewAttr = mergeShaderAttr(D, AL, ShaderType);
1220 bool SemaHLSL::handleResourceTypeAttr(QualType T, const ParsedAttr &AL) {
1223 Diag(AL.getLoc(), diag::err_hlsl_attribute_needs_intangible_type)
1224 << AL << getASTContext().HLSLResourceTy;
1229 if (!AL.checkExactlyNumArgs(SemaRef, AL.getMinArgs()))
1233 switch (AL.getKind()) {
1235 if (!AL.isArgIdent(0)) {
1236 Diag(AL.getLoc(), diag::err_attribute_argument_type)
1237 << AL << AANT_ArgumentIdentifier;
1241 IdentifierLoc *Loc = AL.getArgAsIdent(0);
1252 A = HLSLResourceClassAttr::Create(getASTContext(), RC, AL.getLoc());
1257 A = HLSLROVAttr::Create(getASTContext(), AL.getLoc());
1261 A = HLSLRawBufferAttr::Create(getASTContext(), AL.getLoc());
1265 if (AL.getNumArgs() != 1 && !AL.hasParsedType()) {
1266 Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << AL << 1;
1271 QualType QT = SemaRef.GetTypeFromParser(AL.getTypeArg(), &TSI);
1276 A = HLSLContainedTypeAttr::Create(getASTContext(), TSI, AL.getLoc());
1483 void SemaHLSL::handleResourceBindingAttr(Decl *TheDecl, const ParsedAttr &AL) {
1493 if (!AL.isArgIdent(0)) {
1494 Diag(AL.getLoc(), diag::err_attribute_argument_type)
1495 << AL << AANT_ArgumentIdentifier;
1499 IdentifierLoc *Loc = AL.getArgAsIdent(0);
1505 if (AL.getNumArgs() == 2) {
1508 if (!AL.isArgIdent(1)) {
1509 Diag(AL.getLoc(), diag::err_attribute_argument_type)
1510 << AL << AANT_ArgumentIdentifier;
1514 IdentifierLoc *Loc = AL.getArgAsIdent(1);
1558 HLSLResourceBindingAttr::Create(getASTContext(), Slot, Space, AL);
1565 void SemaHLSL::handleParamModifierAttr(Decl *D, const ParsedAttr &AL) {
1567 D, AL,
1568 static_cast<HLSLParamModifierAttr::Spelling>(AL.getSemanticSpelling()));