@@ -761,19 +761,17 @@ static void promoteNonCPtrUseDevicePtrArgsToUseDeviceAddr(
761761static void getDeclareTargetInfo (
762762 lower::AbstractConverter &converter, semantics::SemanticsContext &semaCtx,
763763 lower::pft::Evaluation &eval,
764- const parser::OpenMPDeclareTargetConstruct &declareTargetConstruct ,
764+ const parser::OpenMPDeclareTargetConstruct &construct ,
765765 mlir::omp::DeclareTargetOperands &clauseOps,
766766 llvm::SmallVectorImpl<DeclareTargetCaptureInfo> &symbolAndClause) {
767- const auto &spec =
768- std::get<parser::OmpDeclareTargetSpecifier>(declareTargetConstruct.t );
769- if (const auto *objectList{parser::Unwrap<parser::OmpObjectList>(spec.u )}) {
770- ObjectList objects{makeObjects (*objectList, semaCtx)};
767+
768+ if (!construct.v .Arguments ().v .empty ()) {
769+ ObjectList objects{makeObjects (construct.v .Arguments (), semaCtx)};
771770 // Case: declare target(func, var1, var2)
772771 gatherFuncAndVarSyms (objects, mlir::omp::DeclareTargetCaptureClause::to,
773772 symbolAndClause, /* automap=*/ false );
774- } else if (const auto *clauseList{
775- parser::Unwrap<parser::OmpClauseList>(spec.u )}) {
776- List<Clause> clauses = makeClauses (*clauseList, semaCtx);
773+ } else {
774+ List<Clause> clauses = makeClauses (construct.v .Clauses (), semaCtx);
777775 if (clauses.empty ()) {
778776 Fortran::lower::pft::FunctionLikeUnit *owningProc =
779777 eval.getOwningProcedure ();
0 commit comments