1 //===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file implements the subclesses of Stmt class declared in StmtOpenMP.h 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "clang/AST/StmtOpenMP.h" 14 15 #include "clang/AST/ASTContext.h" 16 17 using namespace clang; 18 19 void OMPExecutableDirective::setClauses(ArrayRef<OMPClause *> Clauses) { 20 assert(Clauses.size() == getNumClauses() && 21 "Number of clauses is not the same as the preallocated buffer"); 22 std::copy(Clauses.begin(), Clauses.end(), getClauses().begin()); 23 } 24 25 bool OMPExecutableDirective::isStandaloneDirective() const { 26 // Special case: 'omp target enter data', 'omp target exit data', 27 // 'omp target update' are stand-alone directives, but for implementation 28 // reasons they have empty synthetic structured block, to simplify codegen. 29 if (isa<OMPTargetEnterDataDirective>(this) || 30 isa<OMPTargetExitDataDirective>(this) || 31 isa<OMPTargetUpdateDirective>(this)) 32 return true; 33 return !hasAssociatedStmt() || !getAssociatedStmt(); 34 } 35 36 const Stmt *OMPExecutableDirective::getStructuredBlock() const { 37 assert(!isStandaloneDirective() && 38 "Standalone Executable Directives don't have Structured Blocks."); 39 if (auto *LD = dyn_cast<OMPLoopDirective>(this)) 40 return LD->getBody(); 41 return getInnermostCapturedStmt()->getCapturedStmt(); 42 } 43 44 void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) { 45 assert(A.size() == getCollapsedNumber() && 46 "Number of loop counters is not the same as the collapsed number"); 47 std::copy(A.begin(), A.end(), getCounters().begin()); 48 } 49 50 void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) { 51 assert(A.size() == getCollapsedNumber() && "Number of loop private counters " 52 "is not the same as the collapsed " 53 "number"); 54 std::copy(A.begin(), A.end(), getPrivateCounters().begin()); 55 } 56 57 void OMPLoopDirective::setInits(ArrayRef<Expr *> A) { 58 assert(A.size() == getCollapsedNumber() && 59 "Number of counter inits is not the same as the collapsed number"); 60 std::copy(A.begin(), A.end(), getInits().begin()); 61 } 62 63 void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) { 64 assert(A.size() == getCollapsedNumber() && 65 "Number of counter updates is not the same as the collapsed number"); 66 std::copy(A.begin(), A.end(), getUpdates().begin()); 67 } 68 69 void OMPLoopDirective::setFinals(ArrayRef<Expr *> A) { 70 assert(A.size() == getCollapsedNumber() && 71 "Number of counter finals is not the same as the collapsed number"); 72 std::copy(A.begin(), A.end(), getFinals().begin()); 73 } 74 75 void OMPLoopDirective::setDependentCounters(ArrayRef<Expr *> A) { 76 assert( 77 A.size() == getCollapsedNumber() && 78 "Number of dependent counters is not the same as the collapsed number"); 79 llvm::copy(A, getDependentCounters().begin()); 80 } 81 82 void OMPLoopDirective::setDependentInits(ArrayRef<Expr *> A) { 83 assert(A.size() == getCollapsedNumber() && 84 "Number of dependent inits is not the same as the collapsed number"); 85 llvm::copy(A, getDependentInits().begin()); 86 } 87 88 void OMPLoopDirective::setFinalsConditions(ArrayRef<Expr *> A) { 89 assert(A.size() == getCollapsedNumber() && 90 "Number of finals conditions is not the same as the collapsed number"); 91 llvm::copy(A, getFinalsConditions().begin()); 92 } 93 94 OMPParallelDirective *OMPParallelDirective::Create( 95 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 96 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) { 97 unsigned Size = 98 llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *)); 99 void *Mem = 100 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 101 OMPParallelDirective *Dir = 102 new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size()); 103 Dir->setClauses(Clauses); 104 Dir->setAssociatedStmt(AssociatedStmt); 105 Dir->setHasCancel(HasCancel); 106 return Dir; 107 } 108 109 OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C, 110 unsigned NumClauses, 111 EmptyShell) { 112 unsigned Size = 113 llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *)); 114 void *Mem = 115 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 116 return new (Mem) OMPParallelDirective(NumClauses); 117 } 118 119 OMPSimdDirective * 120 OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, 121 SourceLocation EndLoc, unsigned CollapsedNum, 122 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 123 const HelperExprs &Exprs) { 124 unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *)); 125 void *Mem = 126 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 127 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd)); 128 OMPSimdDirective *Dir = new (Mem) 129 OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 130 Dir->setClauses(Clauses); 131 Dir->setAssociatedStmt(AssociatedStmt); 132 Dir->setIterationVariable(Exprs.IterationVarRef); 133 Dir->setLastIteration(Exprs.LastIteration); 134 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 135 Dir->setPreCond(Exprs.PreCond); 136 Dir->setCond(Exprs.Cond); 137 Dir->setInit(Exprs.Init); 138 Dir->setInc(Exprs.Inc); 139 Dir->setCounters(Exprs.Counters); 140 Dir->setPrivateCounters(Exprs.PrivateCounters); 141 Dir->setInits(Exprs.Inits); 142 Dir->setUpdates(Exprs.Updates); 143 Dir->setFinals(Exprs.Finals); 144 Dir->setDependentCounters(Exprs.DependentCounters); 145 Dir->setDependentInits(Exprs.DependentInits); 146 Dir->setFinalsConditions(Exprs.FinalsConditions); 147 Dir->setPreInits(Exprs.PreInits); 148 return Dir; 149 } 150 151 OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C, 152 unsigned NumClauses, 153 unsigned CollapsedNum, 154 EmptyShell) { 155 unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *)); 156 void *Mem = 157 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 158 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd)); 159 return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses); 160 } 161 162 OMPForDirective * 163 OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc, 164 SourceLocation EndLoc, unsigned CollapsedNum, 165 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 166 const HelperExprs &Exprs, bool HasCancel) { 167 unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *)); 168 void *Mem = 169 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 170 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for)); 171 OMPForDirective *Dir = 172 new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 173 Dir->setClauses(Clauses); 174 Dir->setAssociatedStmt(AssociatedStmt); 175 Dir->setIterationVariable(Exprs.IterationVarRef); 176 Dir->setLastIteration(Exprs.LastIteration); 177 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 178 Dir->setPreCond(Exprs.PreCond); 179 Dir->setCond(Exprs.Cond); 180 Dir->setInit(Exprs.Init); 181 Dir->setInc(Exprs.Inc); 182 Dir->setIsLastIterVariable(Exprs.IL); 183 Dir->setLowerBoundVariable(Exprs.LB); 184 Dir->setUpperBoundVariable(Exprs.UB); 185 Dir->setStrideVariable(Exprs.ST); 186 Dir->setEnsureUpperBound(Exprs.EUB); 187 Dir->setNextLowerBound(Exprs.NLB); 188 Dir->setNextUpperBound(Exprs.NUB); 189 Dir->setNumIterations(Exprs.NumIterations); 190 Dir->setCounters(Exprs.Counters); 191 Dir->setPrivateCounters(Exprs.PrivateCounters); 192 Dir->setInits(Exprs.Inits); 193 Dir->setUpdates(Exprs.Updates); 194 Dir->setFinals(Exprs.Finals); 195 Dir->setDependentCounters(Exprs.DependentCounters); 196 Dir->setDependentInits(Exprs.DependentInits); 197 Dir->setFinalsConditions(Exprs.FinalsConditions); 198 Dir->setPreInits(Exprs.PreInits); 199 Dir->setHasCancel(HasCancel); 200 return Dir; 201 } 202 203 OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C, 204 unsigned NumClauses, 205 unsigned CollapsedNum, 206 EmptyShell) { 207 unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *)); 208 void *Mem = 209 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 210 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for)); 211 return new (Mem) OMPForDirective(CollapsedNum, NumClauses); 212 } 213 214 OMPForSimdDirective * 215 OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, 216 SourceLocation EndLoc, unsigned CollapsedNum, 217 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 218 const HelperExprs &Exprs) { 219 unsigned Size = 220 llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *)); 221 void *Mem = 222 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 223 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd)); 224 OMPForSimdDirective *Dir = new (Mem) 225 OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 226 Dir->setClauses(Clauses); 227 Dir->setAssociatedStmt(AssociatedStmt); 228 Dir->setIterationVariable(Exprs.IterationVarRef); 229 Dir->setLastIteration(Exprs.LastIteration); 230 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 231 Dir->setPreCond(Exprs.PreCond); 232 Dir->setCond(Exprs.Cond); 233 Dir->setInit(Exprs.Init); 234 Dir->setInc(Exprs.Inc); 235 Dir->setIsLastIterVariable(Exprs.IL); 236 Dir->setLowerBoundVariable(Exprs.LB); 237 Dir->setUpperBoundVariable(Exprs.UB); 238 Dir->setStrideVariable(Exprs.ST); 239 Dir->setEnsureUpperBound(Exprs.EUB); 240 Dir->setNextLowerBound(Exprs.NLB); 241 Dir->setNextUpperBound(Exprs.NUB); 242 Dir->setNumIterations(Exprs.NumIterations); 243 Dir->setCounters(Exprs.Counters); 244 Dir->setPrivateCounters(Exprs.PrivateCounters); 245 Dir->setInits(Exprs.Inits); 246 Dir->setUpdates(Exprs.Updates); 247 Dir->setFinals(Exprs.Finals); 248 Dir->setDependentCounters(Exprs.DependentCounters); 249 Dir->setDependentInits(Exprs.DependentInits); 250 Dir->setFinalsConditions(Exprs.FinalsConditions); 251 Dir->setPreInits(Exprs.PreInits); 252 return Dir; 253 } 254 255 OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C, 256 unsigned NumClauses, 257 unsigned CollapsedNum, 258 EmptyShell) { 259 unsigned Size = 260 llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *)); 261 void *Mem = 262 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 263 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd)); 264 return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses); 265 } 266 267 OMPSectionsDirective *OMPSectionsDirective::Create( 268 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 269 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) { 270 unsigned Size = 271 llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *)); 272 void *Mem = 273 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 274 OMPSectionsDirective *Dir = 275 new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size()); 276 Dir->setClauses(Clauses); 277 Dir->setAssociatedStmt(AssociatedStmt); 278 Dir->setHasCancel(HasCancel); 279 return Dir; 280 } 281 282 OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C, 283 unsigned NumClauses, 284 EmptyShell) { 285 unsigned Size = 286 llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *)); 287 void *Mem = 288 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 289 return new (Mem) OMPSectionsDirective(NumClauses); 290 } 291 292 OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C, 293 SourceLocation StartLoc, 294 SourceLocation EndLoc, 295 Stmt *AssociatedStmt, 296 bool HasCancel) { 297 unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *)); 298 void *Mem = C.Allocate(Size + sizeof(Stmt *)); 299 OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc); 300 Dir->setAssociatedStmt(AssociatedStmt); 301 Dir->setHasCancel(HasCancel); 302 return Dir; 303 } 304 305 OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C, 306 EmptyShell) { 307 unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *)); 308 void *Mem = C.Allocate(Size + sizeof(Stmt *)); 309 return new (Mem) OMPSectionDirective(); 310 } 311 312 OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C, 313 SourceLocation StartLoc, 314 SourceLocation EndLoc, 315 ArrayRef<OMPClause *> Clauses, 316 Stmt *AssociatedStmt) { 317 unsigned Size = 318 llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *)); 319 void *Mem = 320 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 321 OMPSingleDirective *Dir = 322 new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size()); 323 Dir->setClauses(Clauses); 324 Dir->setAssociatedStmt(AssociatedStmt); 325 return Dir; 326 } 327 328 OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C, 329 unsigned NumClauses, 330 EmptyShell) { 331 unsigned Size = 332 llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *)); 333 void *Mem = 334 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 335 return new (Mem) OMPSingleDirective(NumClauses); 336 } 337 338 OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C, 339 SourceLocation StartLoc, 340 SourceLocation EndLoc, 341 Stmt *AssociatedStmt) { 342 unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *)); 343 void *Mem = C.Allocate(Size + sizeof(Stmt *)); 344 OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc); 345 Dir->setAssociatedStmt(AssociatedStmt); 346 return Dir; 347 } 348 349 OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C, 350 EmptyShell) { 351 unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *)); 352 void *Mem = C.Allocate(Size + sizeof(Stmt *)); 353 return new (Mem) OMPMasterDirective(); 354 } 355 356 OMPCriticalDirective *OMPCriticalDirective::Create( 357 const ASTContext &C, const DeclarationNameInfo &Name, 358 SourceLocation StartLoc, SourceLocation EndLoc, 359 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 360 unsigned Size = 361 llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *)); 362 void *Mem = 363 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 364 OMPCriticalDirective *Dir = 365 new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size()); 366 Dir->setClauses(Clauses); 367 Dir->setAssociatedStmt(AssociatedStmt); 368 return Dir; 369 } 370 371 OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C, 372 unsigned NumClauses, 373 EmptyShell) { 374 unsigned Size = 375 llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *)); 376 void *Mem = 377 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 378 return new (Mem) OMPCriticalDirective(NumClauses); 379 } 380 381 OMPParallelForDirective *OMPParallelForDirective::Create( 382 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 383 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 384 const HelperExprs &Exprs, bool HasCancel) { 385 unsigned Size = 386 llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *)); 387 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 388 sizeof(Stmt *) * 389 numLoopChildren(CollapsedNum, OMPD_parallel_for)); 390 OMPParallelForDirective *Dir = new (Mem) 391 OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 392 Dir->setClauses(Clauses); 393 Dir->setAssociatedStmt(AssociatedStmt); 394 Dir->setIterationVariable(Exprs.IterationVarRef); 395 Dir->setLastIteration(Exprs.LastIteration); 396 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 397 Dir->setPreCond(Exprs.PreCond); 398 Dir->setCond(Exprs.Cond); 399 Dir->setInit(Exprs.Init); 400 Dir->setInc(Exprs.Inc); 401 Dir->setIsLastIterVariable(Exprs.IL); 402 Dir->setLowerBoundVariable(Exprs.LB); 403 Dir->setUpperBoundVariable(Exprs.UB); 404 Dir->setStrideVariable(Exprs.ST); 405 Dir->setEnsureUpperBound(Exprs.EUB); 406 Dir->setNextLowerBound(Exprs.NLB); 407 Dir->setNextUpperBound(Exprs.NUB); 408 Dir->setNumIterations(Exprs.NumIterations); 409 Dir->setCounters(Exprs.Counters); 410 Dir->setPrivateCounters(Exprs.PrivateCounters); 411 Dir->setInits(Exprs.Inits); 412 Dir->setUpdates(Exprs.Updates); 413 Dir->setFinals(Exprs.Finals); 414 Dir->setDependentCounters(Exprs.DependentCounters); 415 Dir->setDependentInits(Exprs.DependentInits); 416 Dir->setFinalsConditions(Exprs.FinalsConditions); 417 Dir->setPreInits(Exprs.PreInits); 418 Dir->setHasCancel(HasCancel); 419 return Dir; 420 } 421 422 OMPParallelForDirective * 423 OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 424 unsigned CollapsedNum, EmptyShell) { 425 unsigned Size = 426 llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *)); 427 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 428 sizeof(Stmt *) * 429 numLoopChildren(CollapsedNum, OMPD_parallel_for)); 430 return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses); 431 } 432 433 OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create( 434 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 435 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 436 const HelperExprs &Exprs) { 437 unsigned Size = 438 llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *)); 439 void *Mem = C.Allocate( 440 Size + sizeof(OMPClause *) * Clauses.size() + 441 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd)); 442 OMPParallelForSimdDirective *Dir = new (Mem) OMPParallelForSimdDirective( 443 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 444 Dir->setClauses(Clauses); 445 Dir->setAssociatedStmt(AssociatedStmt); 446 Dir->setIterationVariable(Exprs.IterationVarRef); 447 Dir->setLastIteration(Exprs.LastIteration); 448 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 449 Dir->setPreCond(Exprs.PreCond); 450 Dir->setCond(Exprs.Cond); 451 Dir->setInit(Exprs.Init); 452 Dir->setInc(Exprs.Inc); 453 Dir->setIsLastIterVariable(Exprs.IL); 454 Dir->setLowerBoundVariable(Exprs.LB); 455 Dir->setUpperBoundVariable(Exprs.UB); 456 Dir->setStrideVariable(Exprs.ST); 457 Dir->setEnsureUpperBound(Exprs.EUB); 458 Dir->setNextLowerBound(Exprs.NLB); 459 Dir->setNextUpperBound(Exprs.NUB); 460 Dir->setNumIterations(Exprs.NumIterations); 461 Dir->setCounters(Exprs.Counters); 462 Dir->setPrivateCounters(Exprs.PrivateCounters); 463 Dir->setInits(Exprs.Inits); 464 Dir->setUpdates(Exprs.Updates); 465 Dir->setFinals(Exprs.Finals); 466 Dir->setDependentCounters(Exprs.DependentCounters); 467 Dir->setDependentInits(Exprs.DependentInits); 468 Dir->setFinalsConditions(Exprs.FinalsConditions); 469 Dir->setPreInits(Exprs.PreInits); 470 return Dir; 471 } 472 473 OMPParallelForSimdDirective * 474 OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C, 475 unsigned NumClauses, 476 unsigned CollapsedNum, EmptyShell) { 477 unsigned Size = 478 llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *)); 479 void *Mem = C.Allocate( 480 Size + sizeof(OMPClause *) * NumClauses + 481 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd)); 482 return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses); 483 } 484 485 OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create( 486 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 487 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) { 488 unsigned Size = 489 llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *)); 490 void *Mem = 491 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 492 OMPParallelSectionsDirective *Dir = 493 new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size()); 494 Dir->setClauses(Clauses); 495 Dir->setAssociatedStmt(AssociatedStmt); 496 Dir->setHasCancel(HasCancel); 497 return Dir; 498 } 499 500 OMPParallelSectionsDirective * 501 OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C, 502 unsigned NumClauses, EmptyShell) { 503 unsigned Size = 504 llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *)); 505 void *Mem = 506 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 507 return new (Mem) OMPParallelSectionsDirective(NumClauses); 508 } 509 510 OMPTaskDirective * 511 OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc, 512 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 513 Stmt *AssociatedStmt, bool HasCancel) { 514 unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *)); 515 void *Mem = 516 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 517 OMPTaskDirective *Dir = 518 new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size()); 519 Dir->setClauses(Clauses); 520 Dir->setAssociatedStmt(AssociatedStmt); 521 Dir->setHasCancel(HasCancel); 522 return Dir; 523 } 524 525 OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C, 526 unsigned NumClauses, 527 EmptyShell) { 528 unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *)); 529 void *Mem = 530 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 531 return new (Mem) OMPTaskDirective(NumClauses); 532 } 533 534 OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C, 535 SourceLocation StartLoc, 536 SourceLocation EndLoc) { 537 void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective)); 538 OMPTaskyieldDirective *Dir = 539 new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc); 540 return Dir; 541 } 542 543 OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C, 544 EmptyShell) { 545 void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective)); 546 return new (Mem) OMPTaskyieldDirective(); 547 } 548 549 OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C, 550 SourceLocation StartLoc, 551 SourceLocation EndLoc) { 552 void *Mem = C.Allocate(sizeof(OMPBarrierDirective)); 553 OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc); 554 return Dir; 555 } 556 557 OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C, 558 EmptyShell) { 559 void *Mem = C.Allocate(sizeof(OMPBarrierDirective)); 560 return new (Mem) OMPBarrierDirective(); 561 } 562 563 OMPTaskwaitDirective *OMPTaskwaitDirective::Create(const ASTContext &C, 564 SourceLocation StartLoc, 565 SourceLocation EndLoc) { 566 void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective)); 567 OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc); 568 return Dir; 569 } 570 571 OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C, 572 EmptyShell) { 573 void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective)); 574 return new (Mem) OMPTaskwaitDirective(); 575 } 576 577 OMPTaskgroupDirective *OMPTaskgroupDirective::Create( 578 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 579 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) { 580 unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) + 581 sizeof(OMPClause *) * Clauses.size(), 582 alignof(Stmt *)); 583 void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *)); 584 OMPTaskgroupDirective *Dir = 585 new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size()); 586 Dir->setAssociatedStmt(AssociatedStmt); 587 Dir->setReductionRef(ReductionRef); 588 Dir->setClauses(Clauses); 589 return Dir; 590 } 591 592 OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C, 593 unsigned NumClauses, 594 EmptyShell) { 595 unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) + 596 sizeof(OMPClause *) * NumClauses, 597 alignof(Stmt *)); 598 void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *)); 599 return new (Mem) OMPTaskgroupDirective(NumClauses); 600 } 601 602 OMPCancellationPointDirective *OMPCancellationPointDirective::Create( 603 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 604 OpenMPDirectiveKind CancelRegion) { 605 unsigned Size = 606 llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *)); 607 void *Mem = C.Allocate(Size); 608 OMPCancellationPointDirective *Dir = 609 new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc); 610 Dir->setCancelRegion(CancelRegion); 611 return Dir; 612 } 613 614 OMPCancellationPointDirective * 615 OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) { 616 unsigned Size = 617 llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *)); 618 void *Mem = C.Allocate(Size); 619 return new (Mem) OMPCancellationPointDirective(); 620 } 621 622 OMPCancelDirective * 623 OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc, 624 SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses, 625 OpenMPDirectiveKind CancelRegion) { 626 unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) + 627 sizeof(OMPClause *) * Clauses.size(), 628 alignof(Stmt *)); 629 void *Mem = C.Allocate(Size); 630 OMPCancelDirective *Dir = 631 new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size()); 632 Dir->setClauses(Clauses); 633 Dir->setCancelRegion(CancelRegion); 634 return Dir; 635 } 636 637 OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C, 638 unsigned NumClauses, 639 EmptyShell) { 640 unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) + 641 sizeof(OMPClause *) * NumClauses, 642 alignof(Stmt *)); 643 void *Mem = C.Allocate(Size); 644 return new (Mem) OMPCancelDirective(NumClauses); 645 } 646 647 OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C, 648 SourceLocation StartLoc, 649 SourceLocation EndLoc, 650 ArrayRef<OMPClause *> Clauses) { 651 unsigned Size = 652 llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *)); 653 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size()); 654 OMPFlushDirective *Dir = 655 new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size()); 656 Dir->setClauses(Clauses); 657 return Dir; 658 } 659 660 OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C, 661 unsigned NumClauses, 662 EmptyShell) { 663 unsigned Size = 664 llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *)); 665 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses); 666 return new (Mem) OMPFlushDirective(NumClauses); 667 } 668 669 OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C, 670 SourceLocation StartLoc, 671 SourceLocation EndLoc, 672 ArrayRef<OMPClause *> Clauses, 673 Stmt *AssociatedStmt) { 674 unsigned Size = 675 llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *)); 676 void *Mem = 677 C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size()); 678 OMPOrderedDirective *Dir = 679 new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size()); 680 Dir->setClauses(Clauses); 681 Dir->setAssociatedStmt(AssociatedStmt); 682 return Dir; 683 } 684 685 OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C, 686 unsigned NumClauses, 687 EmptyShell) { 688 unsigned Size = 689 llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *)); 690 void *Mem = 691 C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses); 692 return new (Mem) OMPOrderedDirective(NumClauses); 693 } 694 695 OMPAtomicDirective *OMPAtomicDirective::Create( 696 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 697 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, 698 Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) { 699 unsigned Size = 700 llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *)); 701 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 702 5 * sizeof(Stmt *)); 703 OMPAtomicDirective *Dir = 704 new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size()); 705 Dir->setClauses(Clauses); 706 Dir->setAssociatedStmt(AssociatedStmt); 707 Dir->setX(X); 708 Dir->setV(V); 709 Dir->setExpr(E); 710 Dir->setUpdateExpr(UE); 711 Dir->IsXLHSInRHSPart = IsXLHSInRHSPart; 712 Dir->IsPostfixUpdate = IsPostfixUpdate; 713 return Dir; 714 } 715 716 OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C, 717 unsigned NumClauses, 718 EmptyShell) { 719 unsigned Size = 720 llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *)); 721 void *Mem = 722 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *)); 723 return new (Mem) OMPAtomicDirective(NumClauses); 724 } 725 726 OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C, 727 SourceLocation StartLoc, 728 SourceLocation EndLoc, 729 ArrayRef<OMPClause *> Clauses, 730 Stmt *AssociatedStmt) { 731 unsigned Size = 732 llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *)); 733 void *Mem = 734 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 735 OMPTargetDirective *Dir = 736 new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size()); 737 Dir->setClauses(Clauses); 738 Dir->setAssociatedStmt(AssociatedStmt); 739 return Dir; 740 } 741 742 OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C, 743 unsigned NumClauses, 744 EmptyShell) { 745 unsigned Size = 746 llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *)); 747 void *Mem = 748 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 749 return new (Mem) OMPTargetDirective(NumClauses); 750 } 751 752 OMPTargetParallelDirective *OMPTargetParallelDirective::Create( 753 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 754 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 755 unsigned Size = 756 llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *)); 757 void *Mem = 758 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 759 OMPTargetParallelDirective *Dir = 760 new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size()); 761 Dir->setClauses(Clauses); 762 Dir->setAssociatedStmt(AssociatedStmt); 763 return Dir; 764 } 765 766 OMPTargetParallelDirective * 767 OMPTargetParallelDirective::CreateEmpty(const ASTContext &C, 768 unsigned NumClauses, EmptyShell) { 769 unsigned Size = 770 llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *)); 771 void *Mem = 772 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 773 return new (Mem) OMPTargetParallelDirective(NumClauses); 774 } 775 776 OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create( 777 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 778 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 779 const HelperExprs &Exprs, bool HasCancel) { 780 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective), 781 alignof(OMPClause *)); 782 void *Mem = C.Allocate( 783 Size + sizeof(OMPClause *) * Clauses.size() + 784 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for)); 785 OMPTargetParallelForDirective *Dir = new (Mem) OMPTargetParallelForDirective( 786 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 787 Dir->setClauses(Clauses); 788 Dir->setAssociatedStmt(AssociatedStmt); 789 Dir->setIterationVariable(Exprs.IterationVarRef); 790 Dir->setLastIteration(Exprs.LastIteration); 791 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 792 Dir->setPreCond(Exprs.PreCond); 793 Dir->setCond(Exprs.Cond); 794 Dir->setInit(Exprs.Init); 795 Dir->setInc(Exprs.Inc); 796 Dir->setIsLastIterVariable(Exprs.IL); 797 Dir->setLowerBoundVariable(Exprs.LB); 798 Dir->setUpperBoundVariable(Exprs.UB); 799 Dir->setStrideVariable(Exprs.ST); 800 Dir->setEnsureUpperBound(Exprs.EUB); 801 Dir->setNextLowerBound(Exprs.NLB); 802 Dir->setNextUpperBound(Exprs.NUB); 803 Dir->setNumIterations(Exprs.NumIterations); 804 Dir->setCounters(Exprs.Counters); 805 Dir->setPrivateCounters(Exprs.PrivateCounters); 806 Dir->setInits(Exprs.Inits); 807 Dir->setUpdates(Exprs.Updates); 808 Dir->setFinals(Exprs.Finals); 809 Dir->setDependentCounters(Exprs.DependentCounters); 810 Dir->setDependentInits(Exprs.DependentInits); 811 Dir->setFinalsConditions(Exprs.FinalsConditions); 812 Dir->setPreInits(Exprs.PreInits); 813 Dir->setHasCancel(HasCancel); 814 return Dir; 815 } 816 817 OMPTargetParallelForDirective * 818 OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C, 819 unsigned NumClauses, 820 unsigned CollapsedNum, EmptyShell) { 821 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective), 822 alignof(OMPClause *)); 823 void *Mem = C.Allocate( 824 Size + sizeof(OMPClause *) * NumClauses + 825 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for)); 826 return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses); 827 } 828 829 OMPTargetDataDirective *OMPTargetDataDirective::Create( 830 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 831 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 832 void *Mem = C.Allocate( 833 llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) + 834 sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 835 OMPTargetDataDirective *Dir = 836 new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size()); 837 Dir->setClauses(Clauses); 838 Dir->setAssociatedStmt(AssociatedStmt); 839 return Dir; 840 } 841 842 OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C, 843 unsigned N, 844 EmptyShell) { 845 void *Mem = C.Allocate( 846 llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) + 847 sizeof(OMPClause *) * N + sizeof(Stmt *)); 848 return new (Mem) OMPTargetDataDirective(N); 849 } 850 851 OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create( 852 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 853 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 854 void *Mem = C.Allocate( 855 llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) + 856 sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 857 OMPTargetEnterDataDirective *Dir = 858 new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size()); 859 Dir->setClauses(Clauses); 860 Dir->setAssociatedStmt(AssociatedStmt); 861 return Dir; 862 } 863 864 OMPTargetEnterDataDirective * 865 OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N, 866 EmptyShell) { 867 void *Mem = C.Allocate( 868 llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) + 869 sizeof(OMPClause *) * N + sizeof(Stmt *)); 870 return new (Mem) OMPTargetEnterDataDirective(N); 871 } 872 873 OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create( 874 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 875 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 876 void *Mem = C.Allocate( 877 llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) + 878 sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 879 OMPTargetExitDataDirective *Dir = 880 new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size()); 881 Dir->setClauses(Clauses); 882 Dir->setAssociatedStmt(AssociatedStmt); 883 return Dir; 884 } 885 886 OMPTargetExitDataDirective * 887 OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N, 888 EmptyShell) { 889 void *Mem = C.Allocate( 890 llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) + 891 sizeof(OMPClause *) * N + sizeof(Stmt *)); 892 return new (Mem) OMPTargetExitDataDirective(N); 893 } 894 895 OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C, 896 SourceLocation StartLoc, 897 SourceLocation EndLoc, 898 ArrayRef<OMPClause *> Clauses, 899 Stmt *AssociatedStmt) { 900 unsigned Size = 901 llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *)); 902 void *Mem = 903 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 904 OMPTeamsDirective *Dir = 905 new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size()); 906 Dir->setClauses(Clauses); 907 Dir->setAssociatedStmt(AssociatedStmt); 908 return Dir; 909 } 910 911 OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C, 912 unsigned NumClauses, 913 EmptyShell) { 914 unsigned Size = 915 llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *)); 916 void *Mem = 917 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 918 return new (Mem) OMPTeamsDirective(NumClauses); 919 } 920 921 OMPTaskLoopDirective *OMPTaskLoopDirective::Create( 922 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 923 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 924 const HelperExprs &Exprs) { 925 unsigned Size = 926 llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *)); 927 void *Mem = 928 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 929 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop)); 930 OMPTaskLoopDirective *Dir = new (Mem) 931 OMPTaskLoopDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 932 Dir->setClauses(Clauses); 933 Dir->setAssociatedStmt(AssociatedStmt); 934 Dir->setIterationVariable(Exprs.IterationVarRef); 935 Dir->setLastIteration(Exprs.LastIteration); 936 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 937 Dir->setPreCond(Exprs.PreCond); 938 Dir->setCond(Exprs.Cond); 939 Dir->setInit(Exprs.Init); 940 Dir->setInc(Exprs.Inc); 941 Dir->setIsLastIterVariable(Exprs.IL); 942 Dir->setLowerBoundVariable(Exprs.LB); 943 Dir->setUpperBoundVariable(Exprs.UB); 944 Dir->setStrideVariable(Exprs.ST); 945 Dir->setEnsureUpperBound(Exprs.EUB); 946 Dir->setNextLowerBound(Exprs.NLB); 947 Dir->setNextUpperBound(Exprs.NUB); 948 Dir->setNumIterations(Exprs.NumIterations); 949 Dir->setCounters(Exprs.Counters); 950 Dir->setPrivateCounters(Exprs.PrivateCounters); 951 Dir->setInits(Exprs.Inits); 952 Dir->setUpdates(Exprs.Updates); 953 Dir->setFinals(Exprs.Finals); 954 Dir->setDependentCounters(Exprs.DependentCounters); 955 Dir->setDependentInits(Exprs.DependentInits); 956 Dir->setFinalsConditions(Exprs.FinalsConditions); 957 Dir->setPreInits(Exprs.PreInits); 958 return Dir; 959 } 960 961 OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C, 962 unsigned NumClauses, 963 unsigned CollapsedNum, 964 EmptyShell) { 965 unsigned Size = 966 llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *)); 967 void *Mem = 968 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 969 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop)); 970 return new (Mem) OMPTaskLoopDirective(CollapsedNum, NumClauses); 971 } 972 973 OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create( 974 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 975 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 976 const HelperExprs &Exprs) { 977 unsigned Size = 978 llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *)); 979 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 980 sizeof(Stmt *) * 981 numLoopChildren(CollapsedNum, OMPD_taskloop_simd)); 982 OMPTaskLoopSimdDirective *Dir = new (Mem) 983 OMPTaskLoopSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 984 Dir->setClauses(Clauses); 985 Dir->setAssociatedStmt(AssociatedStmt); 986 Dir->setIterationVariable(Exprs.IterationVarRef); 987 Dir->setLastIteration(Exprs.LastIteration); 988 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 989 Dir->setPreCond(Exprs.PreCond); 990 Dir->setCond(Exprs.Cond); 991 Dir->setInit(Exprs.Init); 992 Dir->setInc(Exprs.Inc); 993 Dir->setIsLastIterVariable(Exprs.IL); 994 Dir->setLowerBoundVariable(Exprs.LB); 995 Dir->setUpperBoundVariable(Exprs.UB); 996 Dir->setStrideVariable(Exprs.ST); 997 Dir->setEnsureUpperBound(Exprs.EUB); 998 Dir->setNextLowerBound(Exprs.NLB); 999 Dir->setNextUpperBound(Exprs.NUB); 1000 Dir->setNumIterations(Exprs.NumIterations); 1001 Dir->setCounters(Exprs.Counters); 1002 Dir->setPrivateCounters(Exprs.PrivateCounters); 1003 Dir->setInits(Exprs.Inits); 1004 Dir->setUpdates(Exprs.Updates); 1005 Dir->setFinals(Exprs.Finals); 1006 Dir->setDependentCounters(Exprs.DependentCounters); 1007 Dir->setDependentInits(Exprs.DependentInits); 1008 Dir->setFinalsConditions(Exprs.FinalsConditions); 1009 Dir->setPreInits(Exprs.PreInits); 1010 return Dir; 1011 } 1012 1013 OMPTaskLoopSimdDirective * 1014 OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 1015 unsigned CollapsedNum, EmptyShell) { 1016 unsigned Size = 1017 llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *)); 1018 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 1019 sizeof(Stmt *) * 1020 numLoopChildren(CollapsedNum, OMPD_taskloop_simd)); 1021 return new (Mem) OMPTaskLoopSimdDirective(CollapsedNum, NumClauses); 1022 } 1023 1024 OMPMasterTaskLoopDirective *OMPMasterTaskLoopDirective::Create( 1025 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1026 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1027 const HelperExprs &Exprs) { 1028 unsigned Size = 1029 llvm::alignTo(sizeof(OMPMasterTaskLoopDirective), alignof(OMPClause *)); 1030 void *Mem = C.Allocate( 1031 Size + sizeof(OMPClause *) * Clauses.size() + 1032 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_master_taskloop)); 1033 OMPMasterTaskLoopDirective *Dir = new (Mem) OMPMasterTaskLoopDirective( 1034 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1035 Dir->setClauses(Clauses); 1036 Dir->setAssociatedStmt(AssociatedStmt); 1037 Dir->setIterationVariable(Exprs.IterationVarRef); 1038 Dir->setLastIteration(Exprs.LastIteration); 1039 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1040 Dir->setPreCond(Exprs.PreCond); 1041 Dir->setCond(Exprs.Cond); 1042 Dir->setInit(Exprs.Init); 1043 Dir->setInc(Exprs.Inc); 1044 Dir->setIsLastIterVariable(Exprs.IL); 1045 Dir->setLowerBoundVariable(Exprs.LB); 1046 Dir->setUpperBoundVariable(Exprs.UB); 1047 Dir->setStrideVariable(Exprs.ST); 1048 Dir->setEnsureUpperBound(Exprs.EUB); 1049 Dir->setNextLowerBound(Exprs.NLB); 1050 Dir->setNextUpperBound(Exprs.NUB); 1051 Dir->setNumIterations(Exprs.NumIterations); 1052 Dir->setCounters(Exprs.Counters); 1053 Dir->setPrivateCounters(Exprs.PrivateCounters); 1054 Dir->setInits(Exprs.Inits); 1055 Dir->setUpdates(Exprs.Updates); 1056 Dir->setFinals(Exprs.Finals); 1057 Dir->setDependentCounters(Exprs.DependentCounters); 1058 Dir->setDependentInits(Exprs.DependentInits); 1059 Dir->setFinalsConditions(Exprs.FinalsConditions); 1060 Dir->setPreInits(Exprs.PreInits); 1061 return Dir; 1062 } 1063 1064 OMPMasterTaskLoopDirective * 1065 OMPMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, 1066 unsigned NumClauses, 1067 unsigned CollapsedNum, EmptyShell) { 1068 unsigned Size = 1069 llvm::alignTo(sizeof(OMPMasterTaskLoopDirective), alignof(OMPClause *)); 1070 void *Mem = C.Allocate( 1071 Size + sizeof(OMPClause *) * NumClauses + 1072 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_master_taskloop)); 1073 return new (Mem) OMPMasterTaskLoopDirective(CollapsedNum, NumClauses); 1074 } 1075 1076 OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create( 1077 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1078 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1079 const HelperExprs &Exprs) { 1080 unsigned Size = llvm::alignTo(sizeof(OMPMasterTaskLoopSimdDirective), 1081 alignof(OMPClause *)); 1082 void *Mem = 1083 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 1084 sizeof(Stmt *) * 1085 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd)); 1086 auto *Dir = new (Mem) OMPMasterTaskLoopSimdDirective( 1087 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1088 Dir->setClauses(Clauses); 1089 Dir->setAssociatedStmt(AssociatedStmt); 1090 Dir->setIterationVariable(Exprs.IterationVarRef); 1091 Dir->setLastIteration(Exprs.LastIteration); 1092 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1093 Dir->setPreCond(Exprs.PreCond); 1094 Dir->setCond(Exprs.Cond); 1095 Dir->setInit(Exprs.Init); 1096 Dir->setInc(Exprs.Inc); 1097 Dir->setIsLastIterVariable(Exprs.IL); 1098 Dir->setLowerBoundVariable(Exprs.LB); 1099 Dir->setUpperBoundVariable(Exprs.UB); 1100 Dir->setStrideVariable(Exprs.ST); 1101 Dir->setEnsureUpperBound(Exprs.EUB); 1102 Dir->setNextLowerBound(Exprs.NLB); 1103 Dir->setNextUpperBound(Exprs.NUB); 1104 Dir->setNumIterations(Exprs.NumIterations); 1105 Dir->setCounters(Exprs.Counters); 1106 Dir->setPrivateCounters(Exprs.PrivateCounters); 1107 Dir->setInits(Exprs.Inits); 1108 Dir->setUpdates(Exprs.Updates); 1109 Dir->setFinals(Exprs.Finals); 1110 Dir->setDependentCounters(Exprs.DependentCounters); 1111 Dir->setDependentInits(Exprs.DependentInits); 1112 Dir->setFinalsConditions(Exprs.FinalsConditions); 1113 Dir->setPreInits(Exprs.PreInits); 1114 return Dir; 1115 } 1116 1117 OMPMasterTaskLoopSimdDirective * 1118 OMPMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, 1119 unsigned NumClauses, 1120 unsigned CollapsedNum, EmptyShell) { 1121 unsigned Size = llvm::alignTo(sizeof(OMPMasterTaskLoopSimdDirective), 1122 alignof(OMPClause *)); 1123 void *Mem = 1124 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 1125 sizeof(Stmt *) * 1126 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd)); 1127 return new (Mem) OMPMasterTaskLoopSimdDirective(CollapsedNum, NumClauses); 1128 } 1129 1130 OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create( 1131 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1132 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1133 const HelperExprs &Exprs) { 1134 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopDirective), 1135 alignof(OMPClause *)); 1136 void *Mem = C.Allocate( 1137 Size + sizeof(OMPClause *) * Clauses.size() + 1138 sizeof(Stmt *) * 1139 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop)); 1140 auto *Dir = new (Mem) OMPParallelMasterTaskLoopDirective( 1141 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1142 Dir->setClauses(Clauses); 1143 Dir->setAssociatedStmt(AssociatedStmt); 1144 Dir->setIterationVariable(Exprs.IterationVarRef); 1145 Dir->setLastIteration(Exprs.LastIteration); 1146 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1147 Dir->setPreCond(Exprs.PreCond); 1148 Dir->setCond(Exprs.Cond); 1149 Dir->setInit(Exprs.Init); 1150 Dir->setInc(Exprs.Inc); 1151 Dir->setIsLastIterVariable(Exprs.IL); 1152 Dir->setLowerBoundVariable(Exprs.LB); 1153 Dir->setUpperBoundVariable(Exprs.UB); 1154 Dir->setStrideVariable(Exprs.ST); 1155 Dir->setEnsureUpperBound(Exprs.EUB); 1156 Dir->setNextLowerBound(Exprs.NLB); 1157 Dir->setNextUpperBound(Exprs.NUB); 1158 Dir->setNumIterations(Exprs.NumIterations); 1159 Dir->setCounters(Exprs.Counters); 1160 Dir->setPrivateCounters(Exprs.PrivateCounters); 1161 Dir->setInits(Exprs.Inits); 1162 Dir->setUpdates(Exprs.Updates); 1163 Dir->setFinals(Exprs.Finals); 1164 Dir->setDependentCounters(Exprs.DependentCounters); 1165 Dir->setDependentInits(Exprs.DependentInits); 1166 Dir->setFinalsConditions(Exprs.FinalsConditions); 1167 Dir->setPreInits(Exprs.PreInits); 1168 return Dir; 1169 } 1170 1171 OMPParallelMasterTaskLoopDirective * 1172 OMPParallelMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, 1173 unsigned NumClauses, 1174 unsigned CollapsedNum, 1175 EmptyShell) { 1176 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopDirective), 1177 alignof(OMPClause *)); 1178 void *Mem = C.Allocate( 1179 Size + sizeof(OMPClause *) * NumClauses + 1180 sizeof(Stmt *) * 1181 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop)); 1182 return new (Mem) OMPParallelMasterTaskLoopDirective(CollapsedNum, NumClauses); 1183 } 1184 1185 OMPParallelMasterTaskLoopSimdDirective * 1186 OMPParallelMasterTaskLoopSimdDirective::Create( 1187 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1188 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1189 const HelperExprs &Exprs) { 1190 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopSimdDirective), 1191 alignof(OMPClause *)); 1192 void *Mem = C.Allocate( 1193 Size + sizeof(OMPClause *) * Clauses.size() + 1194 sizeof(Stmt *) * 1195 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd)); 1196 auto *Dir = new (Mem) OMPParallelMasterTaskLoopSimdDirective( 1197 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1198 Dir->setClauses(Clauses); 1199 Dir->setAssociatedStmt(AssociatedStmt); 1200 Dir->setIterationVariable(Exprs.IterationVarRef); 1201 Dir->setLastIteration(Exprs.LastIteration); 1202 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1203 Dir->setPreCond(Exprs.PreCond); 1204 Dir->setCond(Exprs.Cond); 1205 Dir->setInit(Exprs.Init); 1206 Dir->setInc(Exprs.Inc); 1207 Dir->setIsLastIterVariable(Exprs.IL); 1208 Dir->setLowerBoundVariable(Exprs.LB); 1209 Dir->setUpperBoundVariable(Exprs.UB); 1210 Dir->setStrideVariable(Exprs.ST); 1211 Dir->setEnsureUpperBound(Exprs.EUB); 1212 Dir->setNextLowerBound(Exprs.NLB); 1213 Dir->setNextUpperBound(Exprs.NUB); 1214 Dir->setNumIterations(Exprs.NumIterations); 1215 Dir->setCounters(Exprs.Counters); 1216 Dir->setPrivateCounters(Exprs.PrivateCounters); 1217 Dir->setInits(Exprs.Inits); 1218 Dir->setUpdates(Exprs.Updates); 1219 Dir->setFinals(Exprs.Finals); 1220 Dir->setDependentCounters(Exprs.DependentCounters); 1221 Dir->setDependentInits(Exprs.DependentInits); 1222 Dir->setFinalsConditions(Exprs.FinalsConditions); 1223 Dir->setPreInits(Exprs.PreInits); 1224 return Dir; 1225 } 1226 1227 OMPParallelMasterTaskLoopSimdDirective * 1228 OMPParallelMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, 1229 unsigned NumClauses, 1230 unsigned CollapsedNum, 1231 EmptyShell) { 1232 unsigned Size = llvm::alignTo(sizeof(OMPParallelMasterTaskLoopSimdDirective), 1233 alignof(OMPClause *)); 1234 void *Mem = C.Allocate( 1235 Size + sizeof(OMPClause *) * NumClauses + 1236 sizeof(Stmt *) * 1237 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd)); 1238 return new (Mem) 1239 OMPParallelMasterTaskLoopSimdDirective(CollapsedNum, NumClauses); 1240 } 1241 1242 OMPDistributeDirective *OMPDistributeDirective::Create( 1243 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1244 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1245 const HelperExprs &Exprs) { 1246 unsigned Size = 1247 llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *)); 1248 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 1249 sizeof(Stmt *) * 1250 numLoopChildren(CollapsedNum, OMPD_distribute)); 1251 OMPDistributeDirective *Dir = new (Mem) 1252 OMPDistributeDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1253 Dir->setClauses(Clauses); 1254 Dir->setAssociatedStmt(AssociatedStmt); 1255 Dir->setIterationVariable(Exprs.IterationVarRef); 1256 Dir->setLastIteration(Exprs.LastIteration); 1257 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1258 Dir->setPreCond(Exprs.PreCond); 1259 Dir->setCond(Exprs.Cond); 1260 Dir->setInit(Exprs.Init); 1261 Dir->setInc(Exprs.Inc); 1262 Dir->setIsLastIterVariable(Exprs.IL); 1263 Dir->setLowerBoundVariable(Exprs.LB); 1264 Dir->setUpperBoundVariable(Exprs.UB); 1265 Dir->setStrideVariable(Exprs.ST); 1266 Dir->setEnsureUpperBound(Exprs.EUB); 1267 Dir->setNextLowerBound(Exprs.NLB); 1268 Dir->setNextUpperBound(Exprs.NUB); 1269 Dir->setNumIterations(Exprs.NumIterations); 1270 Dir->setCounters(Exprs.Counters); 1271 Dir->setPrivateCounters(Exprs.PrivateCounters); 1272 Dir->setInits(Exprs.Inits); 1273 Dir->setUpdates(Exprs.Updates); 1274 Dir->setFinals(Exprs.Finals); 1275 Dir->setDependentCounters(Exprs.DependentCounters); 1276 Dir->setDependentInits(Exprs.DependentInits); 1277 Dir->setFinalsConditions(Exprs.FinalsConditions); 1278 Dir->setPreInits(Exprs.PreInits); 1279 return Dir; 1280 } 1281 1282 OMPDistributeDirective * 1283 OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 1284 unsigned CollapsedNum, EmptyShell) { 1285 unsigned Size = 1286 llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *)); 1287 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 1288 sizeof(Stmt *) * 1289 numLoopChildren(CollapsedNum, OMPD_distribute)); 1290 return new (Mem) OMPDistributeDirective(CollapsedNum, NumClauses); 1291 } 1292 1293 OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create( 1294 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1295 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 1296 unsigned Size = 1297 llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *)); 1298 void *Mem = 1299 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 1300 OMPTargetUpdateDirective *Dir = 1301 new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size()); 1302 Dir->setClauses(Clauses); 1303 Dir->setAssociatedStmt(AssociatedStmt); 1304 return Dir; 1305 } 1306 1307 OMPTargetUpdateDirective * 1308 OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 1309 EmptyShell) { 1310 unsigned Size = 1311 llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *)); 1312 void *Mem = 1313 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 1314 return new (Mem) OMPTargetUpdateDirective(NumClauses); 1315 } 1316 1317 OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create( 1318 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1319 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1320 const HelperExprs &Exprs, bool HasCancel) { 1321 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective), 1322 alignof(OMPClause *)); 1323 void *Mem = C.Allocate( 1324 Size + sizeof(OMPClause *) * Clauses.size() + 1325 sizeof(Stmt *) * 1326 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for)); 1327 OMPDistributeParallelForDirective *Dir = 1328 new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc, 1329 CollapsedNum, Clauses.size()); 1330 Dir->setClauses(Clauses); 1331 Dir->setAssociatedStmt(AssociatedStmt); 1332 Dir->setIterationVariable(Exprs.IterationVarRef); 1333 Dir->setLastIteration(Exprs.LastIteration); 1334 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1335 Dir->setPreCond(Exprs.PreCond); 1336 Dir->setCond(Exprs.Cond); 1337 Dir->setInit(Exprs.Init); 1338 Dir->setInc(Exprs.Inc); 1339 Dir->setIsLastIterVariable(Exprs.IL); 1340 Dir->setLowerBoundVariable(Exprs.LB); 1341 Dir->setUpperBoundVariable(Exprs.UB); 1342 Dir->setStrideVariable(Exprs.ST); 1343 Dir->setEnsureUpperBound(Exprs.EUB); 1344 Dir->setNextLowerBound(Exprs.NLB); 1345 Dir->setNextUpperBound(Exprs.NUB); 1346 Dir->setNumIterations(Exprs.NumIterations); 1347 Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 1348 Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 1349 Dir->setDistInc(Exprs.DistInc); 1350 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 1351 Dir->setCounters(Exprs.Counters); 1352 Dir->setPrivateCounters(Exprs.PrivateCounters); 1353 Dir->setInits(Exprs.Inits); 1354 Dir->setUpdates(Exprs.Updates); 1355 Dir->setFinals(Exprs.Finals); 1356 Dir->setDependentCounters(Exprs.DependentCounters); 1357 Dir->setDependentInits(Exprs.DependentInits); 1358 Dir->setFinalsConditions(Exprs.FinalsConditions); 1359 Dir->setPreInits(Exprs.PreInits); 1360 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 1361 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 1362 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 1363 Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 1364 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 1365 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 1366 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 1367 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 1368 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 1369 Dir->HasCancel = HasCancel; 1370 return Dir; 1371 } 1372 1373 OMPDistributeParallelForDirective * 1374 OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C, 1375 unsigned NumClauses, 1376 unsigned CollapsedNum, 1377 EmptyShell) { 1378 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective), 1379 alignof(OMPClause *)); 1380 void *Mem = C.Allocate( 1381 Size + sizeof(OMPClause *) * NumClauses + 1382 sizeof(Stmt *) * 1383 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for)); 1384 return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses); 1385 } 1386 1387 OMPDistributeParallelForSimdDirective * 1388 OMPDistributeParallelForSimdDirective::Create( 1389 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1390 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1391 const HelperExprs &Exprs) { 1392 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective), 1393 alignof(OMPClause *)); 1394 void *Mem = C.Allocate( 1395 Size + sizeof(OMPClause *) * Clauses.size() + 1396 sizeof(Stmt *) * 1397 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd)); 1398 OMPDistributeParallelForSimdDirective *Dir = new (Mem) 1399 OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum, 1400 Clauses.size()); 1401 Dir->setClauses(Clauses); 1402 Dir->setAssociatedStmt(AssociatedStmt); 1403 Dir->setIterationVariable(Exprs.IterationVarRef); 1404 Dir->setLastIteration(Exprs.LastIteration); 1405 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1406 Dir->setPreCond(Exprs.PreCond); 1407 Dir->setCond(Exprs.Cond); 1408 Dir->setInit(Exprs.Init); 1409 Dir->setInc(Exprs.Inc); 1410 Dir->setIsLastIterVariable(Exprs.IL); 1411 Dir->setLowerBoundVariable(Exprs.LB); 1412 Dir->setUpperBoundVariable(Exprs.UB); 1413 Dir->setStrideVariable(Exprs.ST); 1414 Dir->setEnsureUpperBound(Exprs.EUB); 1415 Dir->setNextLowerBound(Exprs.NLB); 1416 Dir->setNextUpperBound(Exprs.NUB); 1417 Dir->setNumIterations(Exprs.NumIterations); 1418 Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 1419 Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 1420 Dir->setDistInc(Exprs.DistInc); 1421 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 1422 Dir->setCounters(Exprs.Counters); 1423 Dir->setPrivateCounters(Exprs.PrivateCounters); 1424 Dir->setInits(Exprs.Inits); 1425 Dir->setUpdates(Exprs.Updates); 1426 Dir->setFinals(Exprs.Finals); 1427 Dir->setDependentCounters(Exprs.DependentCounters); 1428 Dir->setDependentInits(Exprs.DependentInits); 1429 Dir->setFinalsConditions(Exprs.FinalsConditions); 1430 Dir->setPreInits(Exprs.PreInits); 1431 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 1432 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 1433 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 1434 Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 1435 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 1436 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 1437 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 1438 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 1439 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 1440 return Dir; 1441 } 1442 1443 OMPDistributeParallelForSimdDirective * 1444 OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C, 1445 unsigned NumClauses, 1446 unsigned CollapsedNum, 1447 EmptyShell) { 1448 unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective), 1449 alignof(OMPClause *)); 1450 void *Mem = C.Allocate( 1451 Size + sizeof(OMPClause *) * NumClauses + 1452 sizeof(Stmt *) * 1453 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd)); 1454 return new (Mem) 1455 OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses); 1456 } 1457 1458 OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create( 1459 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1460 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1461 const HelperExprs &Exprs) { 1462 unsigned Size = 1463 llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *)); 1464 void *Mem = C.Allocate( 1465 Size + sizeof(OMPClause *) * Clauses.size() + 1466 sizeof(Stmt *) * 1467 numLoopChildren(CollapsedNum, OMPD_distribute_simd)); 1468 OMPDistributeSimdDirective *Dir = new (Mem) OMPDistributeSimdDirective( 1469 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1470 Dir->setClauses(Clauses); 1471 Dir->setAssociatedStmt(AssociatedStmt); 1472 Dir->setIterationVariable(Exprs.IterationVarRef); 1473 Dir->setLastIteration(Exprs.LastIteration); 1474 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1475 Dir->setPreCond(Exprs.PreCond); 1476 Dir->setCond(Exprs.Cond); 1477 Dir->setInit(Exprs.Init); 1478 Dir->setInc(Exprs.Inc); 1479 Dir->setIsLastIterVariable(Exprs.IL); 1480 Dir->setLowerBoundVariable(Exprs.LB); 1481 Dir->setUpperBoundVariable(Exprs.UB); 1482 Dir->setStrideVariable(Exprs.ST); 1483 Dir->setEnsureUpperBound(Exprs.EUB); 1484 Dir->setNextLowerBound(Exprs.NLB); 1485 Dir->setNextUpperBound(Exprs.NUB); 1486 Dir->setNumIterations(Exprs.NumIterations); 1487 Dir->setCounters(Exprs.Counters); 1488 Dir->setPrivateCounters(Exprs.PrivateCounters); 1489 Dir->setInits(Exprs.Inits); 1490 Dir->setUpdates(Exprs.Updates); 1491 Dir->setFinals(Exprs.Finals); 1492 Dir->setDependentCounters(Exprs.DependentCounters); 1493 Dir->setDependentInits(Exprs.DependentInits); 1494 Dir->setFinalsConditions(Exprs.FinalsConditions); 1495 Dir->setPreInits(Exprs.PreInits); 1496 return Dir; 1497 } 1498 1499 OMPDistributeSimdDirective * 1500 OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C, 1501 unsigned NumClauses, 1502 unsigned CollapsedNum, EmptyShell) { 1503 unsigned Size = 1504 llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *)); 1505 void *Mem = C.Allocate( 1506 Size + sizeof(OMPClause *) * NumClauses + 1507 sizeof(Stmt *) * 1508 numLoopChildren(CollapsedNum, OMPD_distribute_simd)); 1509 return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses); 1510 } 1511 1512 OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create( 1513 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1514 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1515 const HelperExprs &Exprs) { 1516 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective), 1517 alignof(OMPClause *)); 1518 void *Mem = C.Allocate( 1519 Size + sizeof(OMPClause *) * Clauses.size() + 1520 sizeof(Stmt *) * 1521 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd)); 1522 OMPTargetParallelForSimdDirective *Dir = 1523 new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc, 1524 CollapsedNum, Clauses.size()); 1525 Dir->setClauses(Clauses); 1526 Dir->setAssociatedStmt(AssociatedStmt); 1527 Dir->setIterationVariable(Exprs.IterationVarRef); 1528 Dir->setLastIteration(Exprs.LastIteration); 1529 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1530 Dir->setPreCond(Exprs.PreCond); 1531 Dir->setCond(Exprs.Cond); 1532 Dir->setInit(Exprs.Init); 1533 Dir->setInc(Exprs.Inc); 1534 Dir->setIsLastIterVariable(Exprs.IL); 1535 Dir->setLowerBoundVariable(Exprs.LB); 1536 Dir->setUpperBoundVariable(Exprs.UB); 1537 Dir->setStrideVariable(Exprs.ST); 1538 Dir->setEnsureUpperBound(Exprs.EUB); 1539 Dir->setNextLowerBound(Exprs.NLB); 1540 Dir->setNextUpperBound(Exprs.NUB); 1541 Dir->setNumIterations(Exprs.NumIterations); 1542 Dir->setCounters(Exprs.Counters); 1543 Dir->setPrivateCounters(Exprs.PrivateCounters); 1544 Dir->setInits(Exprs.Inits); 1545 Dir->setUpdates(Exprs.Updates); 1546 Dir->setFinals(Exprs.Finals); 1547 Dir->setDependentCounters(Exprs.DependentCounters); 1548 Dir->setDependentInits(Exprs.DependentInits); 1549 Dir->setFinalsConditions(Exprs.FinalsConditions); 1550 Dir->setPreInits(Exprs.PreInits); 1551 return Dir; 1552 } 1553 1554 OMPTargetParallelForSimdDirective * 1555 OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C, 1556 unsigned NumClauses, 1557 unsigned CollapsedNum, 1558 EmptyShell) { 1559 unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective), 1560 alignof(OMPClause *)); 1561 void *Mem = C.Allocate( 1562 Size + sizeof(OMPClause *) * NumClauses + 1563 sizeof(Stmt *) * 1564 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd)); 1565 return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses); 1566 } 1567 1568 OMPTargetSimdDirective * 1569 OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, 1570 SourceLocation EndLoc, unsigned CollapsedNum, 1571 ArrayRef<OMPClause *> Clauses, 1572 Stmt *AssociatedStmt, const HelperExprs &Exprs) { 1573 unsigned Size = 1574 llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *)); 1575 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 1576 sizeof(Stmt *) * 1577 numLoopChildren(CollapsedNum, OMPD_target_simd)); 1578 OMPTargetSimdDirective *Dir = new (Mem) 1579 OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1580 Dir->setClauses(Clauses); 1581 Dir->setAssociatedStmt(AssociatedStmt); 1582 Dir->setIterationVariable(Exprs.IterationVarRef); 1583 Dir->setLastIteration(Exprs.LastIteration); 1584 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1585 Dir->setPreCond(Exprs.PreCond); 1586 Dir->setCond(Exprs.Cond); 1587 Dir->setInit(Exprs.Init); 1588 Dir->setInc(Exprs.Inc); 1589 Dir->setCounters(Exprs.Counters); 1590 Dir->setPrivateCounters(Exprs.PrivateCounters); 1591 Dir->setInits(Exprs.Inits); 1592 Dir->setUpdates(Exprs.Updates); 1593 Dir->setFinals(Exprs.Finals); 1594 Dir->setDependentCounters(Exprs.DependentCounters); 1595 Dir->setDependentInits(Exprs.DependentInits); 1596 Dir->setFinalsConditions(Exprs.FinalsConditions); 1597 Dir->setPreInits(Exprs.PreInits); 1598 return Dir; 1599 } 1600 1601 OMPTargetSimdDirective * 1602 OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 1603 unsigned CollapsedNum, EmptyShell) { 1604 unsigned Size = 1605 llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *)); 1606 void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 1607 sizeof(Stmt *) * 1608 numLoopChildren(CollapsedNum, OMPD_target_simd)); 1609 return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses); 1610 } 1611 1612 OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create( 1613 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1614 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1615 const HelperExprs &Exprs) { 1616 unsigned Size = 1617 llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *)); 1618 void *Mem = C.Allocate( 1619 Size + sizeof(OMPClause *) * Clauses.size() + 1620 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute)); 1621 OMPTeamsDistributeDirective *Dir = new (Mem) OMPTeamsDistributeDirective( 1622 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1623 Dir->setClauses(Clauses); 1624 Dir->setAssociatedStmt(AssociatedStmt); 1625 Dir->setIterationVariable(Exprs.IterationVarRef); 1626 Dir->setLastIteration(Exprs.LastIteration); 1627 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1628 Dir->setPreCond(Exprs.PreCond); 1629 Dir->setCond(Exprs.Cond); 1630 Dir->setInit(Exprs.Init); 1631 Dir->setInc(Exprs.Inc); 1632 Dir->setIsLastIterVariable(Exprs.IL); 1633 Dir->setLowerBoundVariable(Exprs.LB); 1634 Dir->setUpperBoundVariable(Exprs.UB); 1635 Dir->setStrideVariable(Exprs.ST); 1636 Dir->setEnsureUpperBound(Exprs.EUB); 1637 Dir->setNextLowerBound(Exprs.NLB); 1638 Dir->setNextUpperBound(Exprs.NUB); 1639 Dir->setNumIterations(Exprs.NumIterations); 1640 Dir->setCounters(Exprs.Counters); 1641 Dir->setPrivateCounters(Exprs.PrivateCounters); 1642 Dir->setInits(Exprs.Inits); 1643 Dir->setUpdates(Exprs.Updates); 1644 Dir->setFinals(Exprs.Finals); 1645 Dir->setDependentCounters(Exprs.DependentCounters); 1646 Dir->setDependentInits(Exprs.DependentInits); 1647 Dir->setFinalsConditions(Exprs.FinalsConditions); 1648 Dir->setPreInits(Exprs.PreInits); 1649 return Dir; 1650 } 1651 1652 OMPTeamsDistributeDirective * 1653 OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C, 1654 unsigned NumClauses, 1655 unsigned CollapsedNum, EmptyShell) { 1656 unsigned Size = 1657 llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *)); 1658 void *Mem = C.Allocate( 1659 Size + sizeof(OMPClause *) * NumClauses + 1660 sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute)); 1661 return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses); 1662 } 1663 1664 OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create( 1665 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1666 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1667 const HelperExprs &Exprs) { 1668 unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective), 1669 alignof(OMPClause *)); 1670 void *Mem = 1671 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 1672 sizeof(Stmt *) * 1673 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd)); 1674 OMPTeamsDistributeSimdDirective *Dir = 1675 new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum, 1676 Clauses.size()); 1677 Dir->setClauses(Clauses); 1678 Dir->setAssociatedStmt(AssociatedStmt); 1679 Dir->setIterationVariable(Exprs.IterationVarRef); 1680 Dir->setLastIteration(Exprs.LastIteration); 1681 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1682 Dir->setPreCond(Exprs.PreCond); 1683 Dir->setCond(Exprs.Cond); 1684 Dir->setInit(Exprs.Init); 1685 Dir->setInc(Exprs.Inc); 1686 Dir->setIsLastIterVariable(Exprs.IL); 1687 Dir->setLowerBoundVariable(Exprs.LB); 1688 Dir->setUpperBoundVariable(Exprs.UB); 1689 Dir->setStrideVariable(Exprs.ST); 1690 Dir->setEnsureUpperBound(Exprs.EUB); 1691 Dir->setNextLowerBound(Exprs.NLB); 1692 Dir->setNextUpperBound(Exprs.NUB); 1693 Dir->setNumIterations(Exprs.NumIterations); 1694 Dir->setCounters(Exprs.Counters); 1695 Dir->setPrivateCounters(Exprs.PrivateCounters); 1696 Dir->setInits(Exprs.Inits); 1697 Dir->setUpdates(Exprs.Updates); 1698 Dir->setFinals(Exprs.Finals); 1699 Dir->setDependentCounters(Exprs.DependentCounters); 1700 Dir->setDependentInits(Exprs.DependentInits); 1701 Dir->setFinalsConditions(Exprs.FinalsConditions); 1702 Dir->setPreInits(Exprs.PreInits); 1703 return Dir; 1704 } 1705 1706 OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty( 1707 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 1708 EmptyShell) { 1709 unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective), 1710 alignof(OMPClause *)); 1711 void *Mem = 1712 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 1713 sizeof(Stmt *) * 1714 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd)); 1715 return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses); 1716 } 1717 1718 OMPTeamsDistributeParallelForSimdDirective * 1719 OMPTeamsDistributeParallelForSimdDirective::Create( 1720 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1721 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1722 const HelperExprs &Exprs) { 1723 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective), 1724 alignof(OMPClause *)); 1725 void *Mem = 1726 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + 1727 sizeof(Stmt *) * 1728 numLoopChildren(CollapsedNum, 1729 OMPD_teams_distribute_parallel_for_simd)); 1730 OMPTeamsDistributeParallelForSimdDirective *Dir = new (Mem) 1731 OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum, 1732 Clauses.size()); 1733 Dir->setClauses(Clauses); 1734 Dir->setAssociatedStmt(AssociatedStmt); 1735 Dir->setIterationVariable(Exprs.IterationVarRef); 1736 Dir->setLastIteration(Exprs.LastIteration); 1737 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1738 Dir->setPreCond(Exprs.PreCond); 1739 Dir->setCond(Exprs.Cond); 1740 Dir->setInit(Exprs.Init); 1741 Dir->setInc(Exprs.Inc); 1742 Dir->setIsLastIterVariable(Exprs.IL); 1743 Dir->setLowerBoundVariable(Exprs.LB); 1744 Dir->setUpperBoundVariable(Exprs.UB); 1745 Dir->setStrideVariable(Exprs.ST); 1746 Dir->setEnsureUpperBound(Exprs.EUB); 1747 Dir->setNextLowerBound(Exprs.NLB); 1748 Dir->setNextUpperBound(Exprs.NUB); 1749 Dir->setNumIterations(Exprs.NumIterations); 1750 Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 1751 Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 1752 Dir->setDistInc(Exprs.DistInc); 1753 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 1754 Dir->setCounters(Exprs.Counters); 1755 Dir->setPrivateCounters(Exprs.PrivateCounters); 1756 Dir->setInits(Exprs.Inits); 1757 Dir->setUpdates(Exprs.Updates); 1758 Dir->setFinals(Exprs.Finals); 1759 Dir->setDependentCounters(Exprs.DependentCounters); 1760 Dir->setDependentInits(Exprs.DependentInits); 1761 Dir->setFinalsConditions(Exprs.FinalsConditions); 1762 Dir->setPreInits(Exprs.PreInits); 1763 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 1764 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 1765 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 1766 Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 1767 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 1768 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 1769 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 1770 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 1771 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 1772 return Dir; 1773 } 1774 1775 OMPTeamsDistributeParallelForSimdDirective * 1776 OMPTeamsDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C, 1777 unsigned NumClauses, 1778 unsigned CollapsedNum, 1779 EmptyShell) { 1780 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective), 1781 alignof(OMPClause *)); 1782 void *Mem = 1783 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 1784 sizeof(Stmt *) * 1785 numLoopChildren(CollapsedNum, 1786 OMPD_teams_distribute_parallel_for_simd)); 1787 return new (Mem) 1788 OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses); 1789 } 1790 1791 OMPTeamsDistributeParallelForDirective * 1792 OMPTeamsDistributeParallelForDirective::Create( 1793 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1794 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1795 const HelperExprs &Exprs, bool HasCancel) { 1796 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective), 1797 alignof(OMPClause *)); 1798 void *Mem = C.Allocate( 1799 Size + sizeof(OMPClause *) * Clauses.size() + 1800 sizeof(Stmt *) * 1801 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for)); 1802 OMPTeamsDistributeParallelForDirective *Dir = new (Mem) 1803 OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum, 1804 Clauses.size()); 1805 Dir->setClauses(Clauses); 1806 Dir->setAssociatedStmt(AssociatedStmt); 1807 Dir->setIterationVariable(Exprs.IterationVarRef); 1808 Dir->setLastIteration(Exprs.LastIteration); 1809 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1810 Dir->setPreCond(Exprs.PreCond); 1811 Dir->setCond(Exprs.Cond); 1812 Dir->setInit(Exprs.Init); 1813 Dir->setInc(Exprs.Inc); 1814 Dir->setIsLastIterVariable(Exprs.IL); 1815 Dir->setLowerBoundVariable(Exprs.LB); 1816 Dir->setUpperBoundVariable(Exprs.UB); 1817 Dir->setStrideVariable(Exprs.ST); 1818 Dir->setEnsureUpperBound(Exprs.EUB); 1819 Dir->setNextLowerBound(Exprs.NLB); 1820 Dir->setNextUpperBound(Exprs.NUB); 1821 Dir->setNumIterations(Exprs.NumIterations); 1822 Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 1823 Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 1824 Dir->setDistInc(Exprs.DistInc); 1825 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 1826 Dir->setCounters(Exprs.Counters); 1827 Dir->setPrivateCounters(Exprs.PrivateCounters); 1828 Dir->setInits(Exprs.Inits); 1829 Dir->setUpdates(Exprs.Updates); 1830 Dir->setFinals(Exprs.Finals); 1831 Dir->setDependentCounters(Exprs.DependentCounters); 1832 Dir->setDependentInits(Exprs.DependentInits); 1833 Dir->setFinalsConditions(Exprs.FinalsConditions); 1834 Dir->setPreInits(Exprs.PreInits); 1835 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 1836 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 1837 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 1838 Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 1839 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 1840 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 1841 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 1842 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 1843 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 1844 Dir->HasCancel = HasCancel; 1845 return Dir; 1846 } 1847 1848 OMPTeamsDistributeParallelForDirective * 1849 OMPTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C, 1850 unsigned NumClauses, 1851 unsigned CollapsedNum, 1852 EmptyShell) { 1853 auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective), 1854 alignof(OMPClause *)); 1855 void *Mem = C.Allocate( 1856 Size + sizeof(OMPClause *) * NumClauses + 1857 sizeof(Stmt *) * 1858 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for)); 1859 return new (Mem) 1860 OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses); 1861 } 1862 1863 OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create( 1864 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1865 ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) { 1866 auto Size = 1867 llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *)); 1868 void *Mem = 1869 C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); 1870 OMPTargetTeamsDirective *Dir = 1871 new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size()); 1872 Dir->setClauses(Clauses); 1873 Dir->setAssociatedStmt(AssociatedStmt); 1874 return Dir; 1875 } 1876 1877 OMPTargetTeamsDirective * 1878 OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, 1879 EmptyShell) { 1880 auto Size = 1881 llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *)); 1882 void *Mem = 1883 C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); 1884 return new (Mem) OMPTargetTeamsDirective(NumClauses); 1885 } 1886 1887 OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create( 1888 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1889 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1890 const HelperExprs &Exprs) { 1891 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective), 1892 alignof(OMPClause *)); 1893 void *Mem = C.Allocate( 1894 Size + sizeof(OMPClause *) * Clauses.size() + 1895 sizeof(Stmt *) * 1896 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute)); 1897 OMPTargetTeamsDistributeDirective *Dir = 1898 new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum, 1899 Clauses.size()); 1900 Dir->setClauses(Clauses); 1901 Dir->setAssociatedStmt(AssociatedStmt); 1902 Dir->setIterationVariable(Exprs.IterationVarRef); 1903 Dir->setLastIteration(Exprs.LastIteration); 1904 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1905 Dir->setPreCond(Exprs.PreCond); 1906 Dir->setCond(Exprs.Cond); 1907 Dir->setInit(Exprs.Init); 1908 Dir->setInc(Exprs.Inc); 1909 Dir->setIsLastIterVariable(Exprs.IL); 1910 Dir->setLowerBoundVariable(Exprs.LB); 1911 Dir->setUpperBoundVariable(Exprs.UB); 1912 Dir->setStrideVariable(Exprs.ST); 1913 Dir->setEnsureUpperBound(Exprs.EUB); 1914 Dir->setNextLowerBound(Exprs.NLB); 1915 Dir->setNextUpperBound(Exprs.NUB); 1916 Dir->setNumIterations(Exprs.NumIterations); 1917 Dir->setCounters(Exprs.Counters); 1918 Dir->setPrivateCounters(Exprs.PrivateCounters); 1919 Dir->setInits(Exprs.Inits); 1920 Dir->setUpdates(Exprs.Updates); 1921 Dir->setFinals(Exprs.Finals); 1922 Dir->setDependentCounters(Exprs.DependentCounters); 1923 Dir->setDependentInits(Exprs.DependentInits); 1924 Dir->setFinalsConditions(Exprs.FinalsConditions); 1925 Dir->setPreInits(Exprs.PreInits); 1926 return Dir; 1927 } 1928 1929 OMPTargetTeamsDistributeDirective * 1930 OMPTargetTeamsDistributeDirective::CreateEmpty(const ASTContext &C, 1931 unsigned NumClauses, 1932 unsigned CollapsedNum, 1933 EmptyShell) { 1934 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective), 1935 alignof(OMPClause *)); 1936 void *Mem = C.Allocate( 1937 Size + sizeof(OMPClause *) * NumClauses + 1938 sizeof(Stmt *) * 1939 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute)); 1940 return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses); 1941 } 1942 1943 OMPTargetTeamsDistributeParallelForDirective * 1944 OMPTargetTeamsDistributeParallelForDirective::Create( 1945 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 1946 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 1947 const HelperExprs &Exprs, bool HasCancel) { 1948 auto Size = 1949 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective), 1950 alignof(OMPClause *)); 1951 void *Mem = C.Allocate( 1952 Size + sizeof(OMPClause *) * Clauses.size() + 1953 sizeof(Stmt *) * 1954 numLoopChildren(CollapsedNum, 1955 OMPD_target_teams_distribute_parallel_for)); 1956 OMPTargetTeamsDistributeParallelForDirective *Dir = 1957 new (Mem) OMPTargetTeamsDistributeParallelForDirective( 1958 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 1959 Dir->setClauses(Clauses); 1960 Dir->setAssociatedStmt(AssociatedStmt); 1961 Dir->setIterationVariable(Exprs.IterationVarRef); 1962 Dir->setLastIteration(Exprs.LastIteration); 1963 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 1964 Dir->setPreCond(Exprs.PreCond); 1965 Dir->setCond(Exprs.Cond); 1966 Dir->setInit(Exprs.Init); 1967 Dir->setInc(Exprs.Inc); 1968 Dir->setIsLastIterVariable(Exprs.IL); 1969 Dir->setLowerBoundVariable(Exprs.LB); 1970 Dir->setUpperBoundVariable(Exprs.UB); 1971 Dir->setStrideVariable(Exprs.ST); 1972 Dir->setEnsureUpperBound(Exprs.EUB); 1973 Dir->setNextLowerBound(Exprs.NLB); 1974 Dir->setNextUpperBound(Exprs.NUB); 1975 Dir->setNumIterations(Exprs.NumIterations); 1976 Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 1977 Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 1978 Dir->setDistInc(Exprs.DistInc); 1979 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 1980 Dir->setCounters(Exprs.Counters); 1981 Dir->setPrivateCounters(Exprs.PrivateCounters); 1982 Dir->setInits(Exprs.Inits); 1983 Dir->setUpdates(Exprs.Updates); 1984 Dir->setFinals(Exprs.Finals); 1985 Dir->setDependentCounters(Exprs.DependentCounters); 1986 Dir->setDependentInits(Exprs.DependentInits); 1987 Dir->setFinalsConditions(Exprs.FinalsConditions); 1988 Dir->setPreInits(Exprs.PreInits); 1989 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 1990 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 1991 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 1992 Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 1993 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 1994 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 1995 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 1996 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 1997 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 1998 Dir->HasCancel = HasCancel; 1999 return Dir; 2000 } 2001 2002 OMPTargetTeamsDistributeParallelForDirective * 2003 OMPTargetTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C, 2004 unsigned NumClauses, 2005 unsigned CollapsedNum, 2006 EmptyShell) { 2007 auto Size = 2008 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective), 2009 alignof(OMPClause *)); 2010 void *Mem = C.Allocate( 2011 Size + sizeof(OMPClause *) * NumClauses + 2012 sizeof(Stmt *) * 2013 numLoopChildren(CollapsedNum, 2014 OMPD_target_teams_distribute_parallel_for)); 2015 return new (Mem) 2016 OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses); 2017 } 2018 2019 OMPTargetTeamsDistributeParallelForSimdDirective * 2020 OMPTargetTeamsDistributeParallelForSimdDirective::Create( 2021 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 2022 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 2023 const HelperExprs &Exprs) { 2024 auto Size = 2025 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective), 2026 alignof(OMPClause *)); 2027 void *Mem = C.Allocate( 2028 Size + sizeof(OMPClause *) * Clauses.size() + 2029 sizeof(Stmt *) * 2030 numLoopChildren(CollapsedNum, 2031 OMPD_target_teams_distribute_parallel_for_simd)); 2032 OMPTargetTeamsDistributeParallelForSimdDirective *Dir = 2033 new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective( 2034 StartLoc, EndLoc, CollapsedNum, Clauses.size()); 2035 Dir->setClauses(Clauses); 2036 Dir->setAssociatedStmt(AssociatedStmt); 2037 Dir->setIterationVariable(Exprs.IterationVarRef); 2038 Dir->setLastIteration(Exprs.LastIteration); 2039 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 2040 Dir->setPreCond(Exprs.PreCond); 2041 Dir->setCond(Exprs.Cond); 2042 Dir->setInit(Exprs.Init); 2043 Dir->setInc(Exprs.Inc); 2044 Dir->setIsLastIterVariable(Exprs.IL); 2045 Dir->setLowerBoundVariable(Exprs.LB); 2046 Dir->setUpperBoundVariable(Exprs.UB); 2047 Dir->setStrideVariable(Exprs.ST); 2048 Dir->setEnsureUpperBound(Exprs.EUB); 2049 Dir->setNextLowerBound(Exprs.NLB); 2050 Dir->setNextUpperBound(Exprs.NUB); 2051 Dir->setNumIterations(Exprs.NumIterations); 2052 Dir->setPrevLowerBoundVariable(Exprs.PrevLB); 2053 Dir->setPrevUpperBoundVariable(Exprs.PrevUB); 2054 Dir->setDistInc(Exprs.DistInc); 2055 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB); 2056 Dir->setCounters(Exprs.Counters); 2057 Dir->setPrivateCounters(Exprs.PrivateCounters); 2058 Dir->setInits(Exprs.Inits); 2059 Dir->setUpdates(Exprs.Updates); 2060 Dir->setFinals(Exprs.Finals); 2061 Dir->setDependentCounters(Exprs.DependentCounters); 2062 Dir->setDependentInits(Exprs.DependentInits); 2063 Dir->setFinalsConditions(Exprs.FinalsConditions); 2064 Dir->setPreInits(Exprs.PreInits); 2065 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB); 2066 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB); 2067 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB); 2068 Dir->setCombinedInit(Exprs.DistCombinedFields.Init); 2069 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond); 2070 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB); 2071 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB); 2072 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond); 2073 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond); 2074 return Dir; 2075 } 2076 2077 OMPTargetTeamsDistributeParallelForSimdDirective * 2078 OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty( 2079 const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 2080 EmptyShell) { 2081 auto Size = 2082 llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective), 2083 alignof(OMPClause *)); 2084 void *Mem = C.Allocate( 2085 Size + sizeof(OMPClause *) * NumClauses + 2086 sizeof(Stmt *) * 2087 numLoopChildren(CollapsedNum, 2088 OMPD_target_teams_distribute_parallel_for_simd)); 2089 return new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective( 2090 CollapsedNum, NumClauses); 2091 } 2092 2093 OMPTargetTeamsDistributeSimdDirective * 2094 OMPTargetTeamsDistributeSimdDirective::Create( 2095 const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, 2096 unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, 2097 const HelperExprs &Exprs) { 2098 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective), 2099 alignof(OMPClause *)); 2100 void *Mem = C.Allocate( 2101 Size + sizeof(OMPClause *) * Clauses.size() + 2102 sizeof(Stmt *) * 2103 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd)); 2104 OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem) 2105 OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum, 2106 Clauses.size()); 2107 Dir->setClauses(Clauses); 2108 Dir->setAssociatedStmt(AssociatedStmt); 2109 Dir->setIterationVariable(Exprs.IterationVarRef); 2110 Dir->setLastIteration(Exprs.LastIteration); 2111 Dir->setCalcLastIteration(Exprs.CalcLastIteration); 2112 Dir->setPreCond(Exprs.PreCond); 2113 Dir->setCond(Exprs.Cond); 2114 Dir->setInit(Exprs.Init); 2115 Dir->setInc(Exprs.Inc); 2116 Dir->setIsLastIterVariable(Exprs.IL); 2117 Dir->setLowerBoundVariable(Exprs.LB); 2118 Dir->setUpperBoundVariable(Exprs.UB); 2119 Dir->setStrideVariable(Exprs.ST); 2120 Dir->setEnsureUpperBound(Exprs.EUB); 2121 Dir->setNextLowerBound(Exprs.NLB); 2122 Dir->setNextUpperBound(Exprs.NUB); 2123 Dir->setNumIterations(Exprs.NumIterations); 2124 Dir->setCounters(Exprs.Counters); 2125 Dir->setPrivateCounters(Exprs.PrivateCounters); 2126 Dir->setInits(Exprs.Inits); 2127 Dir->setUpdates(Exprs.Updates); 2128 Dir->setFinals(Exprs.Finals); 2129 Dir->setDependentCounters(Exprs.DependentCounters); 2130 Dir->setDependentInits(Exprs.DependentInits); 2131 Dir->setFinalsConditions(Exprs.FinalsConditions); 2132 Dir->setPreInits(Exprs.PreInits); 2133 return Dir; 2134 } 2135 2136 OMPTargetTeamsDistributeSimdDirective * 2137 OMPTargetTeamsDistributeSimdDirective::CreateEmpty(const ASTContext &C, 2138 unsigned NumClauses, 2139 unsigned CollapsedNum, 2140 EmptyShell) { 2141 auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective), 2142 alignof(OMPClause *)); 2143 void *Mem = C.Allocate( 2144 Size + sizeof(OMPClause *) * NumClauses + 2145 sizeof(Stmt *) * 2146 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd)); 2147 return new (Mem) 2148 OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses); 2149 } 2150