[clang] [Clang] Remove some dead code in getNumTeamsExprForTargetDirective (PR #95695)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 16 02:33:32 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-codegen

@llvm/pr-subscribers-clang

Author: Shivam Gupta (xgupta)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/95695.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CGOpenMPRuntime.cpp (-2) 


``````````diff
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index f6d12d46cfc07..0c99ee3b8c4a9 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -6037,8 +6037,6 @@ const Expr *CGOpenMPRuntime::getNumTeamsExprForTargetDirective(
         MinTeamsVal = MaxTeamsVal = 1;
         return nullptr;
       }
-      MinTeamsVal = MaxTeamsVal = 1;
-      return nullptr;
     }
     // A value of -1 is used to check if we need to emit no teams region
     MinTeamsVal = MaxTeamsVal = -1;

``````````

</details>


https://github.com/llvm/llvm-project/pull/95695


More information about the cfe-commits mailing list