Skip to content

Commit 93bd239

Browse files
committed
Adapt lowering after name changes in D114829
1 parent 1ad2ba5 commit 93bd239

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

flang/include/flang/Lower/BoxAnalyzer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class BoxAnalyzer : public fir::details::matcher<BoxAnalyzer> {
397397
shapes.push_back(extent < 0 ? 0 : extent);
398398
continue;
399399
}
400-
} else if (subs.ubound().isAssumed()) {
400+
} else if (subs.ubound().isStar()) {
401401
shapes.push_back(fir::SequenceType::getUnknownExtent());
402402
continue;
403403
}

flang/lib/Lower/ConvertVariable.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ static void lowerExplicitLowerBounds(
10121012
auto lb = builder.createConvert(
10131013
loc, idxTy, genScalarValue(converter, loc, expr, symMap, stmtCtx));
10141014
result.emplace_back(lb);
1015-
} else if (!spec->lbound().isDeferred()) {
1015+
} else if (!spec->lbound().isColon()) {
10161016
// Implicit lower bound is 1 (Fortran 2018 section 8.5.8.3 point 3.)
10171017
result.emplace_back(builder.createIntegerConstant(loc, idxTy, 1));
10181018
}
@@ -1049,8 +1049,8 @@ static void lowerExplicitExtents(Fortran::lower::AbstractConverter &converter,
10491049
else
10501050
result.emplace_back(
10511051
computeExtent(builder, loc, lowerBounds[spec.index()], ub));
1052-
} else if (spec.value()->ubound().isAssumed()) {
1053-
// Column extent is undefined. Must be provided by user's code.
1052+
} else if (spec.value()->ubound().isStar()) {
1053+
// Assumed extent is undefined. Must be provided by user's code.
10541054
result.emplace_back(builder.create<fir::UndefOp>(loc, idxTy));
10551055
}
10561056
}
@@ -1179,13 +1179,13 @@ void Fortran::lower::mapSymbolAttributes(
11791179
Fortran::semantics::SomeExpr highEx{*high};
11801180
auto ub = genValue(highEx);
11811181
shapes.emplace_back(builder.createConvert(loc, idxTy, ub));
1182-
} else if (spec->ubound().isDeferred()) {
1183-
assert(box && "deferred bounds require a descriptor");
1182+
} else if (spec->ubound().isColon()) {
1183+
assert(box && "assumed bounds require a descriptor");
11841184
auto dim = builder.createIntegerConstant(loc, idxTy, iter.index());
11851185
auto dimInfo =
11861186
builder.create<fir::BoxDimsOp>(loc, idxTy, idxTy, idxTy, box, dim);
11871187
shapes.emplace_back(dimInfo.getResult(1));
1188-
} else if (spec->ubound().isAssumed()) {
1188+
} else if (spec->ubound().isStar()) {
11891189
shapes.emplace_back(builder.create<fir::UndefOp>(loc, idxTy));
11901190
} else {
11911191
llvm::report_fatal_error("unknown bound category");
@@ -1200,7 +1200,7 @@ void Fortran::lower::mapSymbolAttributes(
12001200
auto *spec = iter.value();
12011201
fir::BoxDimsOp dimInfo;
12021202
mlir::Value ub, lb;
1203-
if (spec->lbound().isDeferred() || spec->ubound().isDeferred()) {
1203+
if (spec->lbound().isColon() || spec->ubound().isColon()) {
12041204
// This is an assumed shape because allocatables and pointers extents
12051205
// are not constant in the scope and are not read here.
12061206
assert(box && "deferred bounds require a descriptor");
@@ -1231,7 +1231,7 @@ void Fortran::lower::mapSymbolAttributes(
12311231
extents.emplace_back(computeExtent(builder, loc, lb, ub));
12321232
} else {
12331233
// An assumed size array. The extent is not computed.
1234-
assert(spec->ubound().isAssumed() && "expected assumed size");
1234+
assert(spec->ubound().isStar() && "expected assumed size");
12351235
lbounds.emplace_back(lb);
12361236
extents.emplace_back(builder.create<fir::UndefOp>(loc, idxTy));
12371237
}

0 commit comments

Comments
 (0)