File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments