@@ -761,19 +761,17 @@ static void promoteNonCPtrUseDevicePtrArgsToUseDeviceAddr(
761
761
static void getDeclareTargetInfo (
762
762
lower::AbstractConverter &converter, semantics::SemanticsContext &semaCtx,
763
763
lower::pft::Evaluation &eval,
764
- const parser::OpenMPDeclareTargetConstruct &declareTargetConstruct ,
764
+ const parser::OpenMPDeclareTargetConstruct &construct ,
765
765
mlir::omp::DeclareTargetOperands &clauseOps,
766
766
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)};
771
770
// Case: declare target(func, var1, var2)
772
771
gatherFuncAndVarSyms (objects, mlir::omp::DeclareTargetCaptureClause::to,
773
772
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);
777
775
if (clauses.empty ()) {
778
776
Fortran::lower::pft::FunctionLikeUnit *owningProc =
779
777
eval.getOwningProcedure ();
0 commit comments