[flang][openacc][NFC] Remove unused genObjectList function
authorValentin Clement <clementval@gmail.com>
Wed, 14 Jun 2023 03:43:44 +0000 (20:43 -0700)
committerValentin Clement <clementval@gmail.com>
Wed, 14 Jun 2023 03:44:22 +0000 (20:44 -0700)
genObjectList is not used anymore. Just remove it.

Depends on D151975

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D151976

flang/lib/Lower/OpenACC.cpp

index d1976ff36b7a6d63fd839f835668399ccfb95a32..b4d40cccc82083a3e04d3b2c1cd963cee138a352 100644 (file)
@@ -33,73 +33,6 @@ getDesignatorNameIfDataRef(const Fortran::parser::Designator &designator) {
   return dataRef ? std::get_if<Fortran::parser::Name>(&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<mlir::Value> &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<Fortran::semantics::HostAssocDetails>())
-        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<Fortran::parser::ArrayElement>(
-                        designator)) {
-                  // Array sections.
-                  fir::ExtendedValue exV =
-                      converter.genExprBox(operandLocation, *expr, stmtCtx);
-                  mlir::Value section = fir::getBase(exV);
-                  auto mem = builder.create<fir::AllocaOp>(
-                      operandLocation, section.getType(), /*pinned=*/false);
-                  builder.create<fir::StoreOp>(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<Fortran::parser::DataRef>(
-                          &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<mlir::Value>
 genBoundsOpsFromBox(fir::FirOpBuilder &builder, mlir::Location loc,