-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[OpenMP][Clang][NFC] Initializer all of ScanInfo member variables and add deleted copy ctor and assignment operator #158130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Static analysis flagged that we were not initializing all of the members of ScanInfo, fix this so that they are all initialized.
@llvm/pr-subscribers-flang-openmp Author: Shafik Yaghmour (shafik) ChangesStatic analysis flagged that we were not initializing all of the members of ScanInfo, fix this so that they are all initialized. Full diff: https://github.com/llvm/llvm-project/pull/158130.diff 1 Files Affected:
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 *>();
|
ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/19955 Here is the relevant piece of the build log for the reference
|
Static analysis flagged that we were not initializing all of the members of ScanInfo, fix this so that they are all initialized. Also it pointed out that we were not following the rule of three. We had a custom destructor but not copy constructor or assignment. We should never copy or assignment so defaulting them as deleted.