Skip to content

Commit

Permalink
[flang][NFC] Remove obsolete DoLoopHelper
Browse files Browse the repository at this point in the history
During the upstreaming process from fir-dev some
new builder have been introduced in the `flang/Optimizer/Builder`
directory. This patch removes the obsolete DoLoopHelper still present
in the lowering directories and makes use of the new one where needed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118442
  • Loading branch information
clementval committed Jan 28, 2022
1 parent 8a0d0a3 commit 47a66f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 94 deletions.
45 changes: 0 additions & 45 deletions flang/include/flang/Lower/DoLoopHelper.h

This file was deleted.

1 change: 0 additions & 1 deletion flang/lib/Lower/CMakeLists.txt
Expand Up @@ -6,7 +6,6 @@ add_flang_library(FortranLower
Coarray.cpp
ComplexExpr.cpp
ConvertType.cpp
DoLoopHelper.cpp
IntrinsicCall.cpp
IO.cpp
Mangler.cpp
Expand Down
8 changes: 4 additions & 4 deletions flang/lib/Lower/CharacterExpr.cpp
Expand Up @@ -8,8 +8,8 @@

#include "flang/Lower/CharacterExpr.h"
#include "flang/Lower/ConvertType.h"
#include "flang/Lower/DoLoopHelper.h"
#include "flang/Lower/IntrinsicCall.h"
#include "flang/Optimizer/Builder/DoLoopHelper.h"

//===----------------------------------------------------------------------===//
// CharacterExprHelper implementation
Expand Down Expand Up @@ -179,7 +179,7 @@ void Fortran::lower::CharacterExprHelper::createStoreCharAt(
void Fortran::lower::CharacterExprHelper::createCopy(
const fir::CharBoxValue &dest, const fir::CharBoxValue &src,
mlir::Value count) {
Fortran::lower::DoLoopHelper{builder, loc}.createLoop(
fir::factory::DoLoopHelper{builder, loc}.createLoop(
count, [&](fir::FirOpBuilder &, mlir::Value index) {
auto charVal = createLoadCharAt(src, index);
createStoreCharAt(dest, index, charVal);
Expand All @@ -191,7 +191,7 @@ void Fortran::lower::CharacterExprHelper::createPadding(
auto blank = createBlankConstant(getCharacterType(str));
// Always create the loop, if upper < lower, no iteration will be
// executed.
Fortran::lower::DoLoopHelper{builder, loc}.createLoop(
fir::factory::DoLoopHelper{builder, loc}.createLoop(
lower, upper, [&](fir::FirOpBuilder &, mlir::Value index) {
createStoreCharAt(str, index, blank);
});
Expand Down Expand Up @@ -286,7 +286,7 @@ fir::CharBoxValue Fortran::lower::CharacterExprHelper::createConcatenate(
auto upperBound = builder.create<mlir::arith::SubIOp>(loc, len, one);
auto lhsLen =
builder.createConvert(loc, builder.getIndexType(), lhs.getLen());
Fortran::lower::DoLoopHelper{builder, loc}.createLoop(
fir::factory::DoLoopHelper{builder, loc}.createLoop(
lhs.getLen(), upperBound, one,
[&](fir::FirOpBuilder &bldr, mlir::Value index) {
auto rhsIndex = bldr.create<mlir::arith::SubIOp>(loc, index, lhsLen);
Expand Down
44 changes: 0 additions & 44 deletions flang/lib/Lower/DoLoopHelper.cpp

This file was deleted.

0 comments on commit 47a66f1

Please sign in to comment.