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

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


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

Improves readability and removes static verifier trigger.

>From 1f1c082e0337209534f2f3ed77c410c0e2f81893 Mon Sep 17 00:00:00 2001
From: Helena Kotas <hekotas at microsoft.com>
Date: Fri, 26 Jul 2024 10:10:38 -0700
Subject: [PATCH] [HLSL] Initialize DiagnoseHLSLAvailability members

Improves readability and removes static verifier trigger.
---
 clang/lib/Sema/SemaHLSL.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index 9940bc5b4a606..11686db117ff4 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -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),
+        CurrentShaderStageBit(0), ReportOnlyShaderStageIssues(false) {}
 
   // AST traversal methods
   void RunOnTranslationUnit(const TranslationUnitDecl *TU);



More information about the cfe-commits mailing list