Skip to content

Commit 0b8bb14

Browse files
committed
Minor comment change, use llvm::enumerage
1 parent 8256e93 commit 0b8bb14

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

clang/lib/AST/OpenMPClause.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,8 +1202,12 @@ OMPClauseMappableExprCommon::findAttachPtrExpr(
12021202
// stripping away one component at a time, until we reach a pointer Expr
12031203
// (that is not a binary operator). The first such pointer should be the
12041204
// attach base-pointer for the component list.
1205-
for (size_t I = 1; I < Components.size(); ++I) {
1206-
const Expr *CurExpr = Components[I].getAssociatedExpression();
1205+
for (auto [I, Component] : llvm::enumerate(Components)) {
1206+
// Skip past the first component.
1207+
if (I == 0)
1208+
continue;
1209+
1210+
const Expr *CurExpr = Component.getAssociatedExpression();
12071211
if (!CurExpr)
12081212
break;
12091213

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7209,8 +7209,8 @@ class MappableExprsHandler {
72097209
/// The component-depth of `nullptr` (i.e. no attach-ptr) is `std::nullopt`.
72107210
/// TODO: Not urgent, but we should ideally use the number of pointer
72117211
/// dereferences in an expr as an indicator of its complexity, instead of the
7212-
/// component-depth. That would be needed for us to treat `p[1]`, `*(p + 10)`,
7213-
/// `*(p + 5 + 5)` together.
7212+
/// component-depth. That would be needed for us to treat `p[10]`,
7213+
/// `*(p + 10)`, `*(p + 5 + 5)` together.
72147214
mutable llvm::DenseMap<const Expr *, std::optional<size_t>>
72157215
AttachPtrComponentDepthMap = {{nullptr, std::nullopt}};
72167216

0 commit comments

Comments
 (0)