[flang] [OpenMP] parse tree changes for `OpenMPBlockConstruct` (flang-compiler/f18#632)
* [OpenMP] parse tree changes for `OpenMPBlockConstruct` 1. merge `Workshare` and `Single` into `OpenMPBlockConstruct` because they both accept structured-block and syntax is similar to other block directives. 2. `OpenMPBlockConstruct` changes to structure like `{Begin, Block, End}`, where `Begin` and `End` are tuple of `{Directive, ClauseList}`. 3. Updated the check-omp-structure.* for necessary parts. Added all the END directive enumeration types that may have clauses. More tests will be added during Semantics. * [OpenMP] Update on Tim's suggestion 1. Fix unspecified enumeration for `OmpDirective` in the `OmpContext`. This is through getting rid of `PushContext(source)` function to make sure whenever it is about to push a NEW context, directive source location and enumeration are available. To do that, I moved around all the switches for directive into high level `Construct`'s `Enter` node. Besides fixing the issue, the side benefit is that whenever we call `GetContext().directive`, we are sure that the `directive` here was set already. 2. When `Enter` the `OmpEndBlockDirective` node, partial context information, such as directive source location or legal clause lists, needs to be reset. The new directive source location should be `OmpEndBlockDirective`'s `source`. The enumeration `directive` should not be reset for the END directives that do not accept clauses because nothing needs to be checked (for example any clause that is on `END PARALLEL` is illegal). Original-commit: flang-compiler/f18@e5bd6b7ba0fbe9006f3e431260428b194f2d2616 Reviewed-on: https://github.com/flang-compiler/f18/pull/632
Loading
Please sign in to comment