[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Thu May 23 09:52:33 PDT 2024
================
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
+
+namespace {
+
+/// This class implements HLSL availability diagnostics for default
+/// and relaxed mode
+///
+/// The goal of this diagnostic is to emit an error or warning when an
+/// unavailable API is found in a code that is reachable from the shader
+/// entry function or from an exported function (when compiling shader
+/// library).
+///
+/// This is done by traversing the AST of all shader entry point functions
+/// and of all exported functions, and any functions that are refrenced
+/// from this AST. In other words, any function that are reachable from
+/// the entry points.
+class DiagnoseHLSLAvailability
+ : public RecursiveASTVisitor<DiagnoseHLSLAvailability> {
+ // HEKOTAS this is probably not needed
+ // typedef RecursiveASTVisitor<DiagnoseHLSLAvailability> Base;
----------------
llvm-beanz wrote:
nit:
```suggestion
```
https://github.com/llvm/llvm-project/pull/92704
More information about the cfe-commits
mailing list