Skip to content

Commit b4e472a

Browse files
authored
Merge pull request #956 from flang-compiler/ch-ch5egs
Delete code that was redundantly removing the elided extents before t…
2 parents 4b9d243 + d3c32a4 commit b4e472a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

flang/lib/Lower/ConvertVariable.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,7 @@ static mlir::Value createNewLocal(Fortran::lower::AbstractConverter &converter,
392392
const auto &ultimateSymbol = var.getSymbol().GetUltimate();
393393
auto symNm = toStringRef(ultimateSymbol.name());
394394
auto isTarg = var.isTarget();
395-
if (shape.size())
396-
if (auto arrTy = ty.dyn_cast<fir::SequenceType>()) {
397-
// elide the constant dimensions before construction
398-
assert(shape.size() == arrTy.getDimension());
399-
llvm::SmallVector<mlir::Value> args;
400-
auto typeShape = arrTy.getShape();
401-
for (unsigned i = 0, end = arrTy.getDimension(); i < end; ++i)
402-
if (typeShape[i] == fir::SequenceType::getUnknownExtent())
403-
args.push_back(shape[i]);
404-
return builder.allocateLocal(loc, ty, nm, symNm, args, lenParams, isTarg);
405-
}
395+
// Let the builder do all the heavy lifting.
406396
return builder.allocateLocal(loc, ty, nm, symNm, shape, lenParams, isTarg);
407397
}
408398

0 commit comments

Comments
 (0)