[llvm] [OpenMP][Clang][NFC] Initializer all of ScanInfo member variables (PR #158130)

Shafik Yaghmour via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 11:28:10 PDT 2025


https://github.com/shafik created https://github.com/llvm/llvm-project/pull/158130

Static analysis flagged that we were not initializing all of the members of ScanInfo, fix this so that they are all initialized.

>From 136203b5cc509b82132a717c5ce1c49a22759f0d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Thu, 11 Sep 2025 11:26:59 -0700
Subject: [PATCH] [OpenMP][Clang][NFC] Initializer all of ScanInfo member
 variables

Static analysis flagged that we were not initializing all of the members of
ScanInfo, fix this so that they are all initialized.
---
 llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
index 1050e3d8b08dd..7c36c0ad898f4 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
@@ -3986,11 +3986,11 @@ class ScanInfo {
 
   /// Keeps track of value of iteration variable for input/scan loop to be
   /// used for Scan directive lowering
-  llvm::Value *IV;
+  llvm::Value *IV = nullptr;
 
   /// Stores the span of canonical loop being lowered to be used for temporary
   /// buffer allocation or Finalization.
-  llvm::Value *Span;
+  llvm::Value *Span = nullptr;
 
   ScanInfo() {
     ScanBuffPtrs = new llvm::SmallDenseMap<llvm::Value *, llvm::Value *>();



More information about the llvm-commits mailing list