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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 10:12:35 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-hlsl

Author: Helena Kotas (hekota)

<details>
<summary>Changes</summary>

Improves readability and removes static verifier trigger.

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


1 Files Affected:

- (modified) clang/lib/Sema/SemaHLSL.cpp (+4-1) 


``````````diff
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);

``````````

</details>


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


More information about the cfe-commits mailing list