================
@@ -3226,11 +3227,31 @@ class DiagnoseHLSLAvailability : public
DynamicRecursiveASTVisitor {
}
bool VisitCallExpr(CallExpr *CE) override {
+ DiagnoseQuadAllCall(CE);
DiagnoseBarrierCall(CE);
return true;
}
};
+void DiagnoseHLSLAvailability::DiagnoseQuadAllCall(CallExpr *CE) {
+ const FunctionDecl *FD = CE->getDirectCallee();
+ if (!FD || FD->getBuiltinID() != Builtin::BI__builtin_hlsl_quad_all)
+ return;
+
+ switch (GetCurrentShaderEnvironment()) {
+ case llvm::Triple::UnknownEnvironment:
+ case llvm::Triple::Pixel:
+ case llvm::Triple::Compute:
+ case llvm::Triple::Mesh:
+ case llvm::Triple::Amplification:
+ return;
+ default:
+ SemaRef.Diag(CE->getExprLoc(), diag::err_hlsl_builtin_unsupported_in_stage)
+ << FD
+ << llvm::Triple::getEnvironmentTypeName(GetCurrentShaderEnvironment());
+ }
+}
+
----------------
hekota wrote:
That means this Sema diagnostic code should not be included as part of this PR,
right?
https://github.com/llvm/llvm-project/pull/240645
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits