[clang] [CIR][OpenMP] Lowering for the private clause for scalar local variables (PR #245430)

Pedro da Rosa Pinheiro via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 06:37:26 PST 2026


================
@@ -57,17 +61,18 @@ static mlir::LogicalResult
 emitParallelClauses(CIRGenFunction &cgf, CIRGenModule &cgm,
                     CIRGenBuilderTy &builder, mlir::Location loc,
                     llvm::ArrayRef<const OMPClause *> clauses,
-                    mlir::omp::ParallelOperands &clauseOps) {
+                    mlir::omp::ParallelOperands &clauseOps,
+                    llvm::SmallVector<const VarDecl *> &emittedAsPrivate) {
   OpenMPClauseEmitter ce(cgf, cgm, builder, loc, clauses);
   ce.emitIf(clauseOps, llvm::omp::Directive::OMPD_parallel);
   ce.emitNumThreads(clauseOps);
+  ce.emitPrivate(clauseOps, emittedAsPrivate, emitScalarPrivatizer);
----------------
pedropiin wrote:

I pretend to work on this myself. I'm still wrapping my head around CIR as I started working on it recently, but I do plan on extending this in the future. 
Should we keep it as is?

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


More information about the cfe-commits mailing list