[clang] [OpenMP] Support for `nothing` in `metadirective` (PR #73690)

Deepak Eachempati via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 28 12:58:47 PST 2023


================
@@ -12,7 +12,6 @@ int mixed() {
     x=d;
   }
 
-// expected-error at +2 {{#pragma omp nothing' cannot be an immediate substatement}}
----------------
dreachem wrote:

@alexey-bataev That restriction shouldn't apply to the `nothing` directive.  The `nothing` directive is not executable, and so is not considered a "stand-alone directive". Note that allowing the insertion of the `barrier` directive in the following would push the call to `f()` outside of the if block; that's why it is restricted:

```
if (x)
   #pragma omp barrier
   f();
```

On the other hand, allowing the `nothing` directive in the following should have no effect on the behavior of the program and therefore should be permitted:

```
if (x)
    #pragma omp nothing
   f();
```



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


More information about the cfe-commits mailing list