Author: Zahira Ammarguellat
Date: 2026-11-16T08:16:53-05:00
New Revision: ce6fbd2ba882b5878ff4c34ae584b84c59dc89a3

URL: 
https://github.com/llvm/llvm-project/commit/ce6fbd2ba882b5878ff4c34ae584b84c59dc89a3
DIFF: 
https://github.com/llvm/llvm-project/commit/ce6fbd2ba882b5878ff4c34ae584b84c59dc89a3.diff

LOG: [OpenMP] [NFC] Use setHelperExprs in 
OMPTargetGenericLoopDirective::Create. (#242023)

`OMPTargetGenericLoopDirective::Create` was added in #238448 before
`OMPLoopDirective::setHelperExprs` was introduced in #238950, so it
still sets each helper expression by hand. Use `setHelperExprs` like the
other loop directives.

Added: 
    

Modified: 
    clang/lib/AST/StmtOpenMP.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/StmtOpenMP.cpp b/clang/lib/AST/StmtOpenMP.cpp
index 7ecbe9b79ac71..0fae9fa63c079 100644
--- a/clang/lib/AST/StmtOpenMP.cpp
+++ b/clang/lib/AST/StmtOpenMP.cpp
@@ -2060,30 +2060,7 @@ OMPTargetGenericLoopDirective 
*OMPTargetGenericLoopDirective::Create(
       C, Clauses, AssociatedStmt,
       numLoopChildren(CollapsedNum, OMPD_target_loop), StartLoc, EndLoc,
       CollapsedNum);
-  Dir->setIterationVariable(Exprs.IterationVarRef);
-  Dir->setLastIteration(Exprs.LastIteration);
-  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
-  Dir->setPreCond(Exprs.PreCond);
-  Dir->setCond(Exprs.Cond);
-  Dir->setInit(Exprs.Init);
-  Dir->setInc(Exprs.Inc);
-  Dir->setIsLastIterVariable(Exprs.IL);
-  Dir->setLowerBoundVariable(Exprs.LB);
-  Dir->setUpperBoundVariable(Exprs.UB);
-  Dir->setStrideVariable(Exprs.ST);
-  Dir->setEnsureUpperBound(Exprs.EUB);
-  Dir->setNextLowerBound(Exprs.NLB);
-  Dir->setNextUpperBound(Exprs.NUB);
-  Dir->setNumIterations(Exprs.NumIterations);
-  Dir->setCounters(Exprs.Counters);
-  Dir->setPrivateCounters(Exprs.PrivateCounters);
-  Dir->setInits(Exprs.Inits);
-  Dir->setUpdates(Exprs.Updates);
-  Dir->setFinals(Exprs.Finals);
-  Dir->setDependentCounters(Exprs.DependentCounters);
-  Dir->setDependentInits(Exprs.DependentInits);
-  Dir->setFinalsConditions(Exprs.FinalsConditions);
-  Dir->setPreInits(Exprs.PreInits);
+  Dir->setHelperExprs(Exprs);
   return Dir;
 }
 


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to