SunilKuravinakop wrote:

> The codegen for each(virtual) directive should live on codegen. But(!) Sema 
> should emit separate (specific) CapturedStmts for each such virtual region. 
> Check, how the combined directives work. Sema defines multiple CapturedStmt 
> for each combined directive, and then codegen emits the code for 
> each(virtual) standalone directive, using CapturedStmt for this particular 
> (virtual) standalone directive. The list of captures of each sub-directives 
> might be different, so Sema should provide different CapturedStmt for each 
> emitted sub-directive.

With the present checkin the -ast-dump looks as follows:
```
     |-CompoundStmt 0x17f4a10 <<invalid sloc>>
     |  |-OMPTaskwaitDirective 0x1838208 <line:29:5, col:54> 
openmp_standalone_directive
     |  |  `-OMPDependClause 0x1837dc0 <col:40, col:53>
     |  |   `-DeclRefExpr 0x1837d88 <col:52> 'int' lvalue Var 0x1837890 'x' 
'int'
     |  `-OMPDispatchDirective 0x17f49c0 <col:5, col:54>
     |    |-OMPNocontextClause 0x1837d60 <col:26, col:38>
     |    |  `-ImplicitCastExpr 0x1837d30 <col:36> 'int' <LValueToRValue>
     |    |    `-DeclRefExpr 0x1837d10 <col:36> 'int' lvalue OMPCapturedExpr 
0x1837c90 '.capture_expr.' 'int'
     |    |-OMPDependClause 0x1837dc0 <col:40, col:53>
     |    |       `-DeclRefExpr 0x1837d88 <col:52> 'int' lvalue Var 0x1837890 
'x' 'int'
     |    `-CapturedStmt 0x18381c8 <line:30:5, col:11>
     |        |-CapturedDecl 0x1837ef8 <<invalid sloc>> <invalid sloc>

```
Since, there is no need for a CapturedStmt below OMPTaskDirective none has been 
added.  Can you please review the code. 

https://github.com/llvm/llvm-project/pull/131838
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to