Skip to content

Commit 6a5231e

Browse files
authored
[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.
1 parent e6f3cca commit 6a5231e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,9 +1950,9 @@ class OMPTransformDirectiveScopeRAII {
19501950
Scope = new OMPLoopScope(CGF, *Dir);
19511951
CGSI = new CodeGenFunction::CGCapturedStmtInfo(CR_OpenMP);
19521952
CapInfoRAII = new CodeGenFunction::CGCapturedStmtRAII(CGF, CGSI);
1953-
}
1954-
if (const auto *Dir =
1955-
dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S)) {
1953+
} else if (const auto *Dir =
1954+
dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(
1955+
S)) {
19561956
// For simplicity we reuse the loop scope similarly to what we do with
19571957
// OMPCanonicalLoopNestTransformationDirective do by being a subclass
19581958
// of OMPLoopBasedDirective.

0 commit comments

Comments
 (0)