================ @@ -584,6 +585,32 @@ static Attr *handleOpenCLUnrollHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) OpenCLUnrollHintAttr(S.Context, A, UnrollFactor); } +static Attr *handleHLSLLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, + SourceRange Range) { + unsigned UnrollFactor = 0; + if (A.getNumArgs() == 1) { + Expr *E = A.getArgAsExpr(0); + std::optional<llvm::APSInt> ArgVal; + + if (!(ArgVal = E->getIntegerConstantExpr(S.Context))) { + S.Diag(A.getLoc(), diag::err_attribute_argument_type) ---------------- dmpots wrote:
Are these errors or warnings? It looks like the non-integer expr is a warning in dxc, but the negative constant is an error. Are we trying to match dxc behavior here? In any case, I think we should have tests for these error paths. https://github.com/llvm/llvm-project/pull/93879 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits