[flang-commits] [clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

Kajetan Puchalski via flang-commits flang-commits at lists.llvm.org
Thu Jul 24 05:50:00 PDT 2025


mrkajetanp wrote:

> Have you considered handling this in the prescanning/parsing, semantics or lowering stages? If semantics sees all OpenMP constructs, wouldn't it issue errors if there is a semantic error in a non-simd construct?

We could add checks to ignore semantic errors if the flag is set in the same way lowering TODOs are currently ignored if that's the behaviour we want. Still emitting semantic errors for non-simd OpenMP constructs is the current behaviour in clang:
```
❯ clang -fopenmp-simd broken.c
broken.c:15:17: error: expected an OpenMP directive
   15 |     #pragma omp brokendirective
      |                 ^
1 error generated.
```

https://github.com/llvm/llvm-project/pull/150269


More information about the flang-commits mailing list