diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp --- a/flang/lib/Lower/OpenACC.cpp +++ b/flang/lib/Lower/OpenACC.cpp @@ -33,73 +33,6 @@ return dataRef ? std::get_if(&dataRef->u) : nullptr; } -static void -genObjectList(const Fortran::parser::AccObjectList &objectList, - Fortran::lower::AbstractConverter &converter, - Fortran::semantics::SemanticsContext &semanticsContext, - Fortran::lower::StatementContext &stmtCtx, - llvm::SmallVectorImpl &operands) { - auto addOperands = [&](Fortran::lower::SymbolRef sym) { - const auto variable = converter.getSymbolAddress(sym); - // TODO: Might need revisiting to handle for non-shared clauses - if (variable) { - operands.push_back(variable); - } else { - if (const auto *details = - sym->detailsIf()) - operands.push_back(converter.getSymbolAddress(details->symbol())); - } - }; - - fir::FirOpBuilder &builder = converter.getFirOpBuilder(); - - for (const auto &accObject : objectList.v) { - std::visit( - Fortran::common::visitors{ - [&](const Fortran::parser::Designator &designator) { - mlir::Location operandLocation = - converter.genLocation(designator.source); - if (auto expr{Fortran::semantics::AnalyzeExpr(semanticsContext, - designator)}) { - if ((*expr).Rank() > 0 && - Fortran::parser::Unwrap( - designator)) { - // Array sections. - fir::ExtendedValue exV = - converter.genExprBox(operandLocation, *expr, stmtCtx); - mlir::Value section = fir::getBase(exV); - auto mem = builder.create( - operandLocation, section.getType(), /*pinned=*/false); - builder.create(operandLocation, section, mem); - operands.push_back(mem); - } else if (Fortran::parser::Unwrap< - Fortran::parser::StructureComponent>( - designator)) { - // Derived type components. - fir::ExtendedValue fieldAddr = - converter.genExprAddr(operandLocation, *expr, stmtCtx); - operands.push_back(fir::getBase(fieldAddr)); - } else { - // Scalar or full array. - if (const auto *dataRef{std::get_if( - &designator.u)}) { - const Fortran::parser::Name &name = - Fortran::parser::GetLastName(*dataRef); - addOperands(*name.symbol); - } else { // Unsupported - TODO(operandLocation, - "Unsupported type of OpenACC operand"); - } - } - } - }, - [&](const Fortran::parser::Name &name) { - addOperands(*name.symbol); - }}, - accObject.u); - } -} - /// Generate the acc.bounds operation from the descriptor information. static llvm::SmallVector genBoundsOpsFromBox(fir::FirOpBuilder &builder, mlir::Location loc,