diff --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h index 60d2ad0b764b9..9795a0d2ae25e 100644 --- a/flang/include/flang/Parser/parse-tree.h +++ b/flang/include/flang/Parser/parse-tree.h @@ -271,7 +271,6 @@ struct OpenACCRoutineConstruct; struct OpenMPConstruct; struct OpenMPLoopConstruct; struct OpenMPDeclarativeConstruct; -struct OmpEndLoopDirective; struct CUFKernelDoConstruct; // Cooked character stream locations @@ -539,7 +538,6 @@ struct ExecutableConstruct { common::Indirection, common::Indirection, common::Indirection, - common::Indirection, common::Indirection> u; }; @@ -5359,6 +5357,7 @@ struct OpenMPLoopConstruct { const DoConstruct *GetNestedLoop() const; const OpenMPLoopConstruct *GetNestedConstruct() const; + CharBlock source; std::tuple> t; }; diff --git a/flang/lib/Parser/executable-parsers.cpp b/flang/lib/Parser/executable-parsers.cpp index fadec1f11d1db..8d777a6671495 100644 --- a/flang/lib/Parser/executable-parsers.cpp +++ b/flang/lib/Parser/executable-parsers.cpp @@ -49,7 +49,6 @@ constexpr auto executableConstruct{first( construct(indirect(Parser{})), construct(indirect(whereConstruct)), construct(indirect(forallConstruct)), - construct(indirect(ompEndLoopDirective)), construct(indirect(openmpConstruct)), construct(indirect(Parser{})), construct(indirect(compilerDirective)), diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp index e2da60ed19de8..d50f45794230b 100644 --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -17,6 +17,7 @@ #include "type-parser-implementation.h" #include "flang/Parser/openmp-utils.h" #include "flang/Parser/parse-tree.h" +#include "flang/Parser/tools.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Bitset.h" #include "llvm/ADT/STLExtras.h" @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1656,6 +1658,100 @@ struct LooselyStructuredBlockParser { } }; +struct NonBlockDoConstructParser { + using resultType = Block; + + std::optional Parse(ParseState &state) const { + std::set