[flang] [OpenMP] Canonicalization framework (flang-compiler/f18#599)
* [OpenMP] Canonicalization framework This is mainly designed for loop association work but can be used for others, and `CanonicalizeOmp` must be after `CanonicalizeDo`. At the `Block` level, recognize legal sequence of `OpenMPLoopConstruct`, `DoConstruct`, and `OmpEndLoopDirective`. Move available `DoConstruct` and optional `OmpEndLoopDirective` into `OpenMPLoopConstruct`. Throw error messages if: 1. `DoConstruct` is not following `OpenMPLoopConstruct` 2. `OmpEndLoopDirective` is not following associated do-loop Once this pass this done, Semantics will not proceed if error exists. * Update on reviews 1. extract matching and move part into its own function (once `DoConstruct` is moved, see whether `OpenMPEndLoopDirective` is available) 2. Use a template function to access construct from ExecutionPartConstruct. 3. Move this code into namespace semantics Original-commit: flang-compiler/f18@52979f1e93f40c31e04118067403a258555d139a Reviewed-on: https://github.com/flang-compiler/f18/pull/599
Loading
Please sign in to comment