Skip to content

Commit 50285ea

Browse files
authored
[OpenMP][Clang][NFC] Initializer all of ScanInfo member variables and add deleted copy ctor and assignment operator (#158130)
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.
1 parent 1d65d9c commit 50285ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4001,15 +4001,17 @@ class ScanInfo {
40014001

40024002
/// Keeps track of value of iteration variable for input/scan loop to be
40034003
/// used for Scan directive lowering
4004-
llvm::Value *IV;
4004+
llvm::Value *IV = nullptr;
40054005

40064006
/// Stores the span of canonical loop being lowered to be used for temporary
40074007
/// buffer allocation or Finalization.
4008-
llvm::Value *Span;
4008+
llvm::Value *Span = nullptr;
40094009

40104010
ScanInfo() {
40114011
ScanBuffPtrs = new llvm::SmallDenseMap<llvm::Value *, llvm::Value *>();
40124012
}
4013+
ScanInfo(ScanInfo &) = delete;
4014+
ScanInfo &operator=(const ScanInfo &) = delete;
40134015

40144016
~ScanInfo() { delete (ScanBuffPtrs); }
40154017
};

0 commit comments

Comments
 (0)