[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #131838)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 12:54:54 PDT 2025


================
@@ -4528,6 +4528,115 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) {
   emitMaster(*this, S);
 }
 
+static Expr *getInitialExprFromCapturedExpr(Expr *Cond) {
----------------
SunilKuravinakop wrote:

It is my mistake in naming the function as getInitialExprFromCapturedExpr(). It should have been getCapturedExprFromImplicitCastExpr( ). The function extracts the OMPCapturedExpr from within the clause.  
clause->getCondition() does not give me the OMPCapturedExpr. 
```
(gdb) NoContextC->getCondition()->dump()
ImplicitCastExpr 0x678640 'int' <LValueToRValue>
  `-DeclRefExpr 0x678620 'int' lvalue OMPCapturedExpr 0x6785a0 '.capture_expr.' 'int'
```
`NoContextC `is of type `OMPNocontextClause *`.
If there is a simpler way to get the OMPCapturedExpr please tell me.

At present, I will rename the function name.

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


More information about the llvm-commits mailing list