[clang] 26b7070 - [Clang] Remove some dead code in getNumTeamsExprForTargetDirective (#95695)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 23:52:44 PDT 2024


Author: Shivam Gupta
Date: 2024-07-25T12:22:40+05:30
New Revision: 26b70707fc2cc0ab8883e6492a4808401a6a4bad

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

LOG: [Clang] Remove some dead code in getNumTeamsExprForTargetDirective (#95695)

This was reported in https://pvs-studio.com/en/blog/posts/cpp/1126/,
fragment N9.

V523 The 'then' statement is equivalent to the subsequent code fragment.
CGOpenMPRuntime.cpp:6040, 6036

---------

Co-authored-by: Shivam Gupta <shivma98.tkg at gmail.com>

Added: 
    

Modified: 
    clang/lib/CodeGen/CGOpenMPRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index a6a87ec88ee8a..2cef23c733d25 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -6047,11 +6047,6 @@ const Expr *CGOpenMPRuntime::getNumTeamsExprForTargetDirective(
         MinTeamsVal = MaxTeamsVal = 0;
         return nullptr;
       }
-      if (isOpenMPParallelDirective(NestedDir->getDirectiveKind()) ||
-          isOpenMPSimdDirective(NestedDir->getDirectiveKind())) {
-        MinTeamsVal = MaxTeamsVal = 1;
-        return nullptr;
-      }
       MinTeamsVal = MaxTeamsVal = 1;
       return nullptr;
     }


        


More information about the cfe-commits mailing list