[clang] cc928c6 - [NFC][clang] Fix static analyzer concerns

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 05:30:06 PDT 2023


Author: Podchishchaeva, Mariya
Date: 2023-07-24T05:15:50-07:00
New Revision: cc928c683058b2e43d250234066609008aa02f68

URL: https://github.com/llvm/llvm-project/commit/cc928c683058b2e43d250234066609008aa02f68
DIFF: https://github.com/llvm/llvm-project/commit/cc928c683058b2e43d250234066609008aa02f68.diff

LOG: [NFC][clang] Fix static analyzer concerns

OMPTransformDirectiveScopeRAII doesn't have user-written copy
constructor/assignment operator but it frees memory in the destructor.
Delete these members since doesn't seem that OMPTransformDirectiveScopeRAII
objects are intended for copy.

Reviewed By: tahonermann, ABataev

Differential Revision: https://reviews.llvm.org/D155849

Added: 
    

Modified: 
    clang/lib/CodeGen/CGStmtOpenMP.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 7721feccb46ee2..4910ff6865e43d 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1820,6 +1820,11 @@ class OMPTransformDirectiveScopeRAII {
   CodeGenFunction::CGCapturedStmtInfo *CGSI = nullptr;
   CodeGenFunction::CGCapturedStmtRAII *CapInfoRAII = nullptr;
 
+  OMPTransformDirectiveScopeRAII(const OMPTransformDirectiveScopeRAII &) =
+      delete;
+  OMPTransformDirectiveScopeRAII &
+  operator=(const OMPTransformDirectiveScopeRAII &) = delete;
+
 public:
   OMPTransformDirectiveScopeRAII(CodeGenFunction &CGF, const Stmt *S) {
     if (const auto *Dir = dyn_cast<OMPLoopBasedDirective>(S)) {


        


More information about the cfe-commits mailing list