summaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorRoger Ferrer Ibáñez <rofirrim@gmail.com>2025-11-21 14:59:07 +0100
committerGitHub <noreply@github.com>2025-11-21 14:59:07 +0100
commit6a5231e2005edce724844354f17060c5dd3c68aa (patch)
tree5d95f765ead35ae6c21a2c98ee69db3342478717 /clang
parente6f3cca4e846ff45eaf1d1e57cf297904da7189a (diff)
[clang][OpenMP][CodeGen] Use an else if instead of checking twice (#168776)
These two classes are mutually exclusive so avoid doing the two checks when the first succeeded.
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index efc06a276267..c33867da7ed5 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1950,9 +1950,9 @@ public:
Scope = new OMPLoopScope(CGF, *Dir);
CGSI = new CodeGenFunction::CGCapturedStmtInfo(CR_OpenMP);
CapInfoRAII = new CodeGenFunction::CGCapturedStmtRAII(CGF, CGSI);
- }
- if (const auto *Dir =
- dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S)) {
+ } else if (const auto *Dir =
+ dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(
+ S)) {
// For simplicity we reuse the loop scope similarly to what we do with
// OMPCanonicalLoopNestTransformationDirective do by being a subclass
// of OMPLoopBasedDirective.