[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 13:10:23 PDT 2024


================
@@ -650,7 +650,10 @@ class DiagnoseHLSLAvailability
   bool HasMatchingEnvironmentOrNone(const AvailabilityAttr *AA);
 
 public:
-  DiagnoseHLSLAvailability(Sema &SemaRef) : SemaRef(SemaRef) {}
+  DiagnoseHLSLAvailability(Sema &SemaRef)
+      : SemaRef(SemaRef),
+        CurrentShaderEnvironment(llvm::Triple::UnknownEnvironment),
----------------
hekota wrote:

Right, but this is just the default initialization, these values are not used. They get updated in `SetShaderStageContext` or `SetShaderStageContext` before any analysis is done. This environment value will also be changing when for libraries libraries depending on which entry point is getting scanned.

https://github.com/llvm/llvm-project/pull/100778


More information about the cfe-commits mailing list