14#ifndef LLVM_CLANG_SEMA_SEMAOPENACC_H
15#define LLVM_CLANG_SEMA_SEMAOPENACC_H
24#include "llvm/ADT/SmallVector.h"
25#include "llvm/Support/Compiler.h"
41 struct ComputeConstructInfo {
49 } ActiveComputeConstructInfo;
51 bool isInComputeConstruct()
const {
59 struct LoopCheckingInfo {
63 LLVM_PREFERRED_TYPE(
bool)
64 unsigned TopLevelLoopSeen : 1;
68 LLVM_PREFERRED_TYPE(
bool)
69 unsigned CurLevelHasLoopAlready : 1;
71 } LoopInfo{
false,
false};
80 struct CollapseCheckingInfo {
81 const OpenACCCollapseClause *ActiveCollapse =
nullptr;
88 std::optional<llvm::APSInt> CurCollapseCount;
93 bool CollapseDepthSatisfied =
true;
102 struct TileCheckingInfo {
103 OpenACCTileClause *ActiveTile =
nullptr;
108 UnsignedOrNone CurTileCount = std::nullopt;
113 bool TileDepthSatisfied =
true;
124 struct CacheParseInfo {
125 bool ParsingCacheVarList =
false;
126 bool IsInvalidCacheRef =
false;
139 class ForStmtBeginChecker {
140 SemaOpenACC &SemaRef;
141 SourceLocation ForLoc;
142 bool IsInstantiation =
false;
144 struct RangeForInfo {
145 const CXXForRangeStmt *Uninstantiated =
nullptr;
146 const CXXForRangeStmt *CurrentVersion =
nullptr;
149 RangeForInfo() : Uninstantiated{nullptr}, CurrentVersion{nullptr} {}
150 RangeForInfo(
const CXXForRangeStmt *Uninst,
const CXXForRangeStmt *Cur)
151 : Uninstantiated{Uninst}, CurrentVersion{Cur} {}
155 const Stmt *
Init =
nullptr;
157 const Stmt *Increment =
nullptr;
160 struct CheckForInfo {
165 std::variant<RangeForInfo, CheckForInfo> Info;
167 bool AlreadyChecked =
false;
169 void checkRangeFor();
171 bool checkForInit(
const Stmt *InitStmt,
const ValueDecl *&InitVar,
173 bool checkForCond(
const Stmt *CondStmt,
const ValueDecl *InitVar,
175 bool checkForInc(
const Stmt *IncStmt,
const ValueDecl *InitVar,
bool Diag);
181 ForStmtBeginChecker(SemaOpenACC &SemaRef, SourceLocation ForLoc,
182 const CXXForRangeStmt *RangeFor)
183 : SemaRef(SemaRef), ForLoc(ForLoc), IsInstantiation(
false),
184 Info(RangeForInfo{nullptr, RangeFor}) {}
186 ForStmtBeginChecker(SemaOpenACC &SemaRef, SourceLocation ForLoc,
187 const CXXForRangeStmt *OldRangeFor,
188 const CXXForRangeStmt *RangeFor)
189 : SemaRef(SemaRef), ForLoc(ForLoc), IsInstantiation(
true),
190 Info(RangeForInfo{OldRangeFor, RangeFor}) {}
192 ForStmtBeginChecker(SemaOpenACC &SemaRef, SourceLocation ForLoc,
193 const Stmt *
Init,
const Stmt *Cond,
const Stmt *Inc)
194 : SemaRef(SemaRef), ForLoc(ForLoc), IsInstantiation(
false),
195 Info(CheckForInfo{{}, {
Init, Cond,
Inc}}) {}
197 ForStmtBeginChecker(SemaOpenACC &
SemaRef, SourceLocation ForLoc,
198 const Stmt *OldInit,
const Stmt *OldCond,
199 const Stmt *OldInc,
const Stmt *
Init,
const Stmt *Cond,
202 Info(CheckForInfo{{OldInit, OldCond, OldInc}, {
Init, Cond,
Inc}}) {}
208 void ForStmtBeginHelper(SourceLocation ForLoc, ForStmtBeginChecker &C);
214 llvm::DenseMap<const clang::DeclaratorDecl *, SourceLocation>
215 DeclareVarReferences;
219 llvm::SmallDenseMap<const clang::FunctionDecl *, SourceLocation>
221 OpenACCRoutineDecl *LastRoutineDecl =
nullptr;
223 void CheckLastRoutineDeclNameConflict(
const NamedDecl *ND);
225 bool DiagnoseRequiredClauses(OpenACCDirectiveKind DK, SourceLocation DirLoc,
226 ArrayRef<const OpenACCClause *> Clauses);
228 bool DiagnoseAllowedClauses(OpenACCDirectiveKind DK, OpenACCClauseKind CK,
229 SourceLocation ClauseLoc);
233 bool DiagnoseAllowedOnceClauses(OpenACCDirectiveKind DK, OpenACCClauseKind CK,
234 SourceLocation ClauseLoc,
235 ArrayRef<const OpenACCClause *> Clauses);
236 bool DiagnoseExclusiveClauses(OpenACCDirectiveKind DK, OpenACCClauseKind CK,
237 SourceLocation ClauseLoc,
238 ArrayRef<const OpenACCClause *> Clauses);
247 const Expr *VarExpr) {
248 assert(CK != OpenACCClauseKind::Reduction);
249 return CreateInitRecipe(CK, OpenACCReductionOperator::Invalid, VarExpr);
251 std::pair<VarDecl *, VarDecl *>
254 const Expr *VarExpr);
258 return ActiveComputeConstructInfo;
268 } LoopGangClauseOnKernel;
288 } LoopWithoutSeqInfo;
303 struct DefaultDetails {
307 struct ConditionDetails {
311 struct IntExprDetails {
315 struct VarListDetails {
326 struct DeviceTypeDetails {
329 struct ReductionDetails {
334 struct CollapseDetails {
344 std::variant<std::monostate, clang::StringLiteral *, IdentifierInfo *>
348 std::variant<std::monostate, DefaultDetails, ConditionDetails,
349 IntExprDetails, VarListDetails, WaitDetails, DeviceTypeDetails,
350 ReductionDetails, CollapseDetails, GangDetails, BindDetails>
351 Details = std::monostate{};
356 : DirKind(DirKind), ClauseKind(ClauseKind), ClauseRange(BeginLoc, {}) {}
369 assert(ClauseKind == OpenACCClauseKind::Default &&
370 "Parsed clause is not a default clause");
371 return std::get<DefaultDetails>(Details).DefaultClauseKind;
379 assert((ClauseKind == OpenACCClauseKind::If ||
380 (ClauseKind == OpenACCClauseKind::Self &&
381 DirKind != OpenACCDirectiveKind::Update)) &&
382 "Parsed clause kind does not have a condition expr");
386 if (ClauseKind == OpenACCClauseKind::Self &&
387 std::holds_alternative<std::monostate>(Details))
390 return std::get<ConditionDetails>(Details).ConditionExpr;
394 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
395 ClauseKind == OpenACCClauseKind::NumWorkers ||
396 ClauseKind == OpenACCClauseKind::Async ||
397 ClauseKind == OpenACCClauseKind::DeviceNum ||
398 ClauseKind == OpenACCClauseKind::DefaultAsync ||
399 ClauseKind == OpenACCClauseKind::Tile ||
400 ClauseKind == OpenACCClauseKind::Worker ||
401 ClauseKind == OpenACCClauseKind::Vector ||
402 ClauseKind == OpenACCClauseKind::VectorLength) &&
403 "Parsed clause kind does not have a int exprs");
407 if ((ClauseKind == OpenACCClauseKind::Async ||
408 ClauseKind == OpenACCClauseKind::Worker ||
409 ClauseKind == OpenACCClauseKind::Vector ||
410 ClauseKind == OpenACCClauseKind::Wait) &&
411 std::holds_alternative<std::monostate>(Details))
413 return std::get<IntExprDetails>(Details).IntExprs.size();
417 assert(ClauseKind == OpenACCClauseKind::Wait &&
418 "Parsed clause kind does not have a queues location");
420 if (std::holds_alternative<std::monostate>(Details))
423 return std::get<WaitDetails>(Details).QueuesLoc;
427 assert(ClauseKind == OpenACCClauseKind::Wait &&
428 "Parsed clause kind does not have a device number expr");
430 if (std::holds_alternative<std::monostate>(Details))
433 return std::get<WaitDetails>(Details).DevNumExpr;
437 assert(ClauseKind == OpenACCClauseKind::Wait &&
438 "Parsed clause kind does not have a queue id expr list");
440 if (std::holds_alternative<std::monostate>(Details))
443 return std::get<WaitDetails>(Details).QueueIdExprs;
447 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
448 ClauseKind == OpenACCClauseKind::NumWorkers ||
449 ClauseKind == OpenACCClauseKind::Async ||
450 ClauseKind == OpenACCClauseKind::DeviceNum ||
451 ClauseKind == OpenACCClauseKind::DefaultAsync ||
452 ClauseKind == OpenACCClauseKind::Tile ||
453 ClauseKind == OpenACCClauseKind::Gang ||
454 ClauseKind == OpenACCClauseKind::Worker ||
455 ClauseKind == OpenACCClauseKind::Vector ||
456 ClauseKind == OpenACCClauseKind::VectorLength) &&
457 "Parsed clause kind does not have a int exprs");
459 if (ClauseKind == OpenACCClauseKind::Gang) {
462 if (std::holds_alternative<std::monostate>(Details))
464 return std::get<GangDetails>(Details).IntExprs;
467 return std::get<IntExprDetails>(Details).IntExprs;
475 return std::get<ReductionDetails>(Details).Op;
479 assert(ClauseKind == OpenACCClauseKind::Gang &&
480 "Parsed clause kind does not have gang kind");
483 if (std::holds_alternative<std::monostate>(Details))
485 return std::get<GangDetails>(Details).GangKinds;
489 assert((ClauseKind == OpenACCClauseKind::Private ||
490 ClauseKind == OpenACCClauseKind::NoCreate ||
491 ClauseKind == OpenACCClauseKind::Present ||
492 ClauseKind == OpenACCClauseKind::Copy ||
493 ClauseKind == OpenACCClauseKind::PCopy ||
494 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
495 ClauseKind == OpenACCClauseKind::CopyIn ||
496 ClauseKind == OpenACCClauseKind::PCopyIn ||
497 ClauseKind == OpenACCClauseKind::PresentOrCopyIn ||
498 ClauseKind == OpenACCClauseKind::CopyOut ||
499 ClauseKind == OpenACCClauseKind::PCopyOut ||
500 ClauseKind == OpenACCClauseKind::PresentOrCopyOut ||
501 ClauseKind == OpenACCClauseKind::Create ||
502 ClauseKind == OpenACCClauseKind::PCreate ||
503 ClauseKind == OpenACCClauseKind::PresentOrCreate ||
504 ClauseKind == OpenACCClauseKind::Attach ||
505 ClauseKind == OpenACCClauseKind::Delete ||
506 ClauseKind == OpenACCClauseKind::UseDevice ||
507 ClauseKind == OpenACCClauseKind::Detach ||
508 ClauseKind == OpenACCClauseKind::DevicePtr ||
509 ClauseKind == OpenACCClauseKind::Reduction ||
510 ClauseKind == OpenACCClauseKind::Host ||
511 ClauseKind == OpenACCClauseKind::Device ||
512 ClauseKind == OpenACCClauseKind::DeviceResident ||
513 ClauseKind == OpenACCClauseKind::Link ||
514 (ClauseKind == OpenACCClauseKind::Self &&
515 DirKind == OpenACCDirectiveKind::Update) ||
516 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
517 "Parsed clause kind does not have a var-list");
519 if (ClauseKind == OpenACCClauseKind::Reduction)
520 return std::get<ReductionDetails>(Details).VarList;
522 return std::get<VarListDetails>(Details).VarList;
530 return std::get<VarListDetails>(Details).ModifierKind;
534 assert(ClauseKind == OpenACCClauseKind::Collapse &&
535 "Only 'collapse' has a force tag");
536 return std::get<CollapseDetails>(Details).IsForce;
540 assert(ClauseKind == OpenACCClauseKind::Collapse &&
541 "Only 'collapse' has a loop count");
542 return std::get<CollapseDetails>(Details).LoopCount;
546 assert((ClauseKind == OpenACCClauseKind::DeviceType ||
547 ClauseKind == OpenACCClauseKind::DType) &&
548 "Only 'device_type'/'dtype' has a device-type-arg list");
549 return std::get<DeviceTypeDetails>(Details).Archs;
552 std::variant<std::monostate, clang::StringLiteral *, IdentifierInfo *>
554 assert(ClauseKind == OpenACCClauseKind::Bind &&
555 "Only 'bind' has bind details");
556 return std::get<BindDetails>(Details).Argument;
563 assert(ClauseKind == OpenACCClauseKind::Default &&
564 "Parsed clause is not a default clause");
565 Details = DefaultDetails{DefKind};
569 assert((ClauseKind == OpenACCClauseKind::If ||
570 (ClauseKind == OpenACCClauseKind::Self &&
571 DirKind != OpenACCDirectiveKind::Update)) &&
572 "Parsed clause kind does not have a condition expr");
577 "Condition expression type not scalar/dependent");
579 Details = ConditionDetails{ConditionExpr};
583 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
584 ClauseKind == OpenACCClauseKind::NumWorkers ||
585 ClauseKind == OpenACCClauseKind::Async ||
586 ClauseKind == OpenACCClauseKind::DeviceNum ||
587 ClauseKind == OpenACCClauseKind::DefaultAsync ||
588 ClauseKind == OpenACCClauseKind::Tile ||
589 ClauseKind == OpenACCClauseKind::Worker ||
590 ClauseKind == OpenACCClauseKind::Vector ||
591 ClauseKind == OpenACCClauseKind::VectorLength) &&
592 "Parsed clause kind does not have a int exprs");
593 Details = IntExprDetails{{IntExprs.begin(), IntExprs.end()}};
596 assert((ClauseKind == OpenACCClauseKind::NumGangs ||
597 ClauseKind == OpenACCClauseKind::NumWorkers ||
598 ClauseKind == OpenACCClauseKind::Async ||
599 ClauseKind == OpenACCClauseKind::DeviceNum ||
600 ClauseKind == OpenACCClauseKind::DefaultAsync ||
601 ClauseKind == OpenACCClauseKind::Tile ||
602 ClauseKind == OpenACCClauseKind::Worker ||
603 ClauseKind == OpenACCClauseKind::Vector ||
604 ClauseKind == OpenACCClauseKind::VectorLength) &&
605 "Parsed clause kind does not have a int exprs");
606 Details = IntExprDetails{std::move(IntExprs)};
611 assert(ClauseKind == OpenACCClauseKind::Gang &&
612 "Parsed Clause kind does not have gang details");
613 assert(GKs.size() == IntExprs.size() &&
"Mismatched kind/size?");
615 Details = GangDetails{{GKs.begin(), GKs.end()},
616 {IntExprs.begin(), IntExprs.end()}};
621 assert(ClauseKind == OpenACCClauseKind::Gang &&
622 "Parsed Clause kind does not have gang details");
623 assert(GKs.size() == IntExprs.size() &&
"Mismatched kind/size?");
625 Details = GangDetails{std::move(GKs), std::move(IntExprs)};
630 assert((ClauseKind == OpenACCClauseKind::Private ||
631 ClauseKind == OpenACCClauseKind::NoCreate ||
632 ClauseKind == OpenACCClauseKind::Present ||
633 ClauseKind == OpenACCClauseKind::Copy ||
634 ClauseKind == OpenACCClauseKind::PCopy ||
635 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
636 ClauseKind == OpenACCClauseKind::CopyIn ||
637 ClauseKind == OpenACCClauseKind::PCopyIn ||
638 ClauseKind == OpenACCClauseKind::PresentOrCopyIn ||
639 ClauseKind == OpenACCClauseKind::CopyOut ||
640 ClauseKind == OpenACCClauseKind::PCopyOut ||
641 ClauseKind == OpenACCClauseKind::PresentOrCopyOut ||
642 ClauseKind == OpenACCClauseKind::Create ||
643 ClauseKind == OpenACCClauseKind::PCreate ||
644 ClauseKind == OpenACCClauseKind::PresentOrCreate ||
645 ClauseKind == OpenACCClauseKind::Attach ||
646 ClauseKind == OpenACCClauseKind::Delete ||
647 ClauseKind == OpenACCClauseKind::UseDevice ||
648 ClauseKind == OpenACCClauseKind::Detach ||
649 ClauseKind == OpenACCClauseKind::DevicePtr ||
650 ClauseKind == OpenACCClauseKind::Host ||
651 ClauseKind == OpenACCClauseKind::Device ||
652 ClauseKind == OpenACCClauseKind::DeviceResident ||
653 ClauseKind == OpenACCClauseKind::Link ||
654 (ClauseKind == OpenACCClauseKind::Self &&
655 DirKind == OpenACCDirectiveKind::Update) ||
656 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
657 "Parsed clause kind does not have a var-list");
658 assert((ModKind == OpenACCModifierKind::Invalid ||
659 ClauseKind == OpenACCClauseKind::Copy ||
660 ClauseKind == OpenACCClauseKind::PCopy ||
661 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
662 ClauseKind == OpenACCClauseKind::CopyIn ||
663 ClauseKind == OpenACCClauseKind::PCopyIn ||
664 ClauseKind == OpenACCClauseKind::PresentOrCopyIn ||
665 ClauseKind == OpenACCClauseKind::CopyOut ||
666 ClauseKind == OpenACCClauseKind::PCopyOut ||
667 ClauseKind == OpenACCClauseKind::PresentOrCopyOut ||
668 ClauseKind == OpenACCClauseKind::Create ||
669 ClauseKind == OpenACCClauseKind::PCreate ||
670 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
671 "Modifier Kind only valid on copy, copyin, copyout, create");
672 Details = VarListDetails{{VarList.begin(), VarList.end()}, ModKind};
677 assert((ClauseKind == OpenACCClauseKind::Private ||
678 ClauseKind == OpenACCClauseKind::NoCreate ||
679 ClauseKind == OpenACCClauseKind::Present ||
680 ClauseKind == OpenACCClauseKind::Copy ||
681 ClauseKind == OpenACCClauseKind::PCopy ||
682 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
683 ClauseKind == OpenACCClauseKind::CopyIn ||
684 ClauseKind == OpenACCClauseKind::PCopyIn ||
685 ClauseKind == OpenACCClauseKind::PresentOrCopyIn ||
686 ClauseKind == OpenACCClauseKind::CopyOut ||
687 ClauseKind == OpenACCClauseKind::PCopyOut ||
688 ClauseKind == OpenACCClauseKind::PresentOrCopyOut ||
689 ClauseKind == OpenACCClauseKind::Create ||
690 ClauseKind == OpenACCClauseKind::PCreate ||
691 ClauseKind == OpenACCClauseKind::PresentOrCreate ||
692 ClauseKind == OpenACCClauseKind::Attach ||
693 ClauseKind == OpenACCClauseKind::Delete ||
694 ClauseKind == OpenACCClauseKind::UseDevice ||
695 ClauseKind == OpenACCClauseKind::Detach ||
696 ClauseKind == OpenACCClauseKind::DevicePtr ||
697 ClauseKind == OpenACCClauseKind::Host ||
698 ClauseKind == OpenACCClauseKind::Device ||
699 ClauseKind == OpenACCClauseKind::DeviceResident ||
700 ClauseKind == OpenACCClauseKind::Link ||
701 (ClauseKind == OpenACCClauseKind::Self &&
702 DirKind == OpenACCDirectiveKind::Update) ||
703 ClauseKind == OpenACCClauseKind::FirstPrivate) &&
704 "Parsed clause kind does not have a var-list");
705 assert((ModKind == OpenACCModifierKind::Invalid ||
706 ClauseKind == OpenACCClauseKind::Copy ||
707 ClauseKind == OpenACCClauseKind::PCopy ||
708 ClauseKind == OpenACCClauseKind::PresentOrCopy ||
709 ClauseKind == OpenACCClauseKind::CopyIn ||
710 ClauseKind == OpenACCClauseKind::PCopyIn ||
711 ClauseKind == OpenACCClauseKind::PresentOrCopyIn ||
712 ClauseKind == OpenACCClauseKind::CopyOut ||
713 ClauseKind == OpenACCClauseKind::PCopyOut ||
714 ClauseKind == OpenACCClauseKind::PresentOrCopyOut ||
715 ClauseKind == OpenACCClauseKind::Create ||
716 ClauseKind == OpenACCClauseKind::PCreate ||
717 ClauseKind == OpenACCClauseKind::PresentOrCreate) &&
718 "Modifier Kind only valid on copy, copyin, copyout, create");
719 Details = VarListDetails{std::move(VarList), ModKind};
724 assert(ClauseKind == OpenACCClauseKind::Reduction &&
725 "reduction details only valid on reduction");
726 Details = ReductionDetails{Op, std::move(VarList)};
731 assert(ClauseKind == OpenACCClauseKind::Wait &&
732 "Parsed clause kind does not have a wait-details");
733 Details = WaitDetails{DevNum, QueuesLoc, std::move(IntExprs)};
737 assert((ClauseKind == OpenACCClauseKind::DeviceType ||
738 ClauseKind == OpenACCClauseKind::DType) &&
739 "Only 'device_type'/'dtype' has a device-type-arg list");
740 Details = DeviceTypeDetails{std::move(Archs)};
744 assert(ClauseKind == OpenACCClauseKind::Collapse &&
745 "Only 'collapse' has collapse details");
746 Details = CollapseDetails{IsForce, LoopCount};
750 std::variant<std::monostate, clang::StringLiteral *, IdentifierInfo *>
752 assert(ClauseKind == OpenACCClauseKind::Bind &&
753 "Only 'bind' has bind details");
754 Details = BindDetails{Arg};
767 const Stmt *RangeFor);
772 const Stmt *Second,
const Stmt *Third);
774 const Stmt *First,
const Stmt *OldSecond,
775 const Stmt *Second,
const Stmt *OldThird,
784 OpenACCParsedClause &Clause);
816 return ActOnAssociatedStmt(DirectiveLoc, K, OpenACCAtomicKind::None,
858 Decl *NextParsedDecl);
865 OpenACCRoutineDeclAttr *
866 mergeRoutineDeclAttr(
const OpenACCRoutineDeclAttr &Old);
890 void ActOnInvalidParseVar();
899 void ActOnVariableDeclarator(
VarDecl *VD);
971 LoopCheckingInfo OldLoopInfo;
972 CollapseCheckingInfo OldCollapseInfo;
973 TileCheckingInfo OldTileInfo;
978 : SemaRef(SemaRef), OldLoopInfo(SemaRef.LoopInfo),
979 OldCollapseInfo(SemaRef.CollapseInfo), OldTileInfo(SemaRef.TileInfo),
980 PreserveDepth(PreserveDepth) {}
985 bool CollapseDepthSatisified =
986 PreserveDepth ? SemaRef.CollapseInfo.CollapseDepthSatisfied
987 : OldCollapseInfo.CollapseDepthSatisfied;
988 bool TileDepthSatisfied = PreserveDepth
989 ? SemaRef.TileInfo.TileDepthSatisfied
990 : OldTileInfo.TileDepthSatisfied;
991 bool CurLevelHasLoopAlready =
992 PreserveDepth ? SemaRef.LoopInfo.CurLevelHasLoopAlready
993 : OldLoopInfo.CurLevelHasLoopAlready;
995 SemaRef.LoopInfo = OldLoopInfo;
996 SemaRef.CollapseInfo = OldCollapseInfo;
997 SemaRef.TileInfo = OldTileInfo;
999 SemaRef.CollapseInfo.CollapseDepthSatisfied = CollapseDepthSatisified;
1000 SemaRef.TileInfo.TileDepthSatisfied = TileDepthSatisfied;
1001 SemaRef.LoopInfo.CurLevelHasLoopAlready = CurLevelHasLoopAlready;
1010 ComputeConstructInfo OldActiveComputeConstructInfo;
1023 void SetCollapseInfoBeforeAssociatedStmt(
1026 void SetTileInfoBeforeAssociatedStmt(
enum clang::sema::@1840::IndirectLocalPathEntry::EntryKind Kind
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines some OpenACC-specific enums and functions.
Defines the clang::SourceLocation class and associated facilities.
This file defines OpenACC AST classes for statement-level contructs.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Represents a function declaration or definition.
A simple pair of identifier info and location.
Wrapper for void* pointer.
This is the base type for all OpenACC Clauses.
A (possibly-)qualified type.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
Helper type for the registration/assignment of constructs that need to 'know' about their parent cons...
Helper type to restore the state of various 'loop' constructs when we run into a loop (for,...
LoopInConstructRAII(SemaOpenACC &SemaRef, bool PreserveDepth=true)
A type to represent all the data for an OpenACC Clause that has been parsed, but not yet created/sema...
void setVarListDetails(ArrayRef< Expr * > VarList, OpenACCModifierKind ModKind)
ArrayRef< Expr * > getIntExprs()
ArrayRef< Expr * > getQueueIdExprs() const
OpenACCDirectiveKind getDirectiveKind() const
ArrayRef< OpenACCGangKind > getGangKinds() const
OpenACCParsedClause(OpenACCDirectiveKind DirKind, OpenACCClauseKind ClauseKind, SourceLocation BeginLoc)
OpenACCReductionOperator getReductionOp() const
SourceLocation getEndLoc() const
void setLParenLoc(SourceLocation EndLoc)
void setConditionDetails(Expr *ConditionExpr)
void setCollapseDetails(bool IsForce, Expr *LoopCount)
OpenACCClauseKind getClauseKind() const
void setGangDetails(ArrayRef< OpenACCGangKind > GKs, ArrayRef< Expr * > IntExprs)
const Expr * getConditionExpr() const
SourceLocation getLParenLoc() const
ArrayRef< DeviceTypeArgument > getDeviceTypeArchitectures() const
std::variant< std::monostate, clang::StringLiteral *, IdentifierInfo * > getBindDetails() const
void setIntExprDetails(llvm::SmallVector< Expr * > &&IntExprs)
void setReductionDetails(OpenACCReductionOperator Op, llvm::SmallVector< Expr * > &&VarList)
Expr * getConditionExpr()
ArrayRef< Expr * > getVarList() const
SourceLocation getBeginLoc() const
void setDefaultDetails(OpenACCDefaultClauseKind DefKind)
SourceLocation getQueuesLoc() const
OpenACCModifierKind getModifierList() const
Expr * getDevNumExpr() const
ArrayRef< Expr * > getVarList()
unsigned getNumIntExprs() const
void setWaitDetails(Expr *DevNum, SourceLocation QueuesLoc, llvm::SmallVector< Expr * > &&IntExprs)
void setEndLoc(SourceLocation EndLoc)
ArrayRef< Expr * > getIntExprs() const
Expr * getLoopCount() const
void setIntExprDetails(ArrayRef< Expr * > IntExprs)
void setBindDetails(std::variant< std::monostate, clang::StringLiteral *, IdentifierInfo * > Arg)
void setVarListDetails(llvm::SmallVector< Expr * > &&VarList, OpenACCModifierKind ModKind)
void setDeviceTypeDetails(llvm::SmallVector< DeviceTypeArgument > &&Archs)
void setGangDetails(llvm::SmallVector< OpenACCGangKind > &&GKs, llvm::SmallVector< Expr * > &&IntExprs)
OpenACCDefaultClauseKind getDefaultClauseKind() const
ComputeConstructInfo & getActiveComputeConstructInfo()
SourceLocation LoopWorkerClauseLoc
If there is a current 'active' loop construct with a 'worker' clause on it (on any sort of construct)...
SourceLocation LoopVectorClauseLoc
If there is a current 'active' loop construct with a 'vector' clause on it (on any sort of construct)...
StmtResult ActOnAssociatedStmt(SourceLocation DirectiveLoc, OpenACCDirectiveKind K, ArrayRef< const OpenACCClause * > Clauses, StmtResult AssocStmt)
std::pair< VarDecl *, VarDecl * > CreateInitRecipe(OpenACCClauseKind CK, const Expr *VarExpr)
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
void setEnd(SourceLocation e)
Stmt - This represents one statement.
bool isScalarType() const
Represents a variable declaration or definition.
DirectiveKind
Represents the kind of preprocessor directive or a module declaration that is tracked by the scanner ...
bool Init(InterpState &S, CodePtr OpPC)
bool Inc(InterpState &S, CodePtr OpPC, bool CanOverflow)
1) Pops a pointer from the stack 2) Load the value from the pointer 3) Writes the value increased by ...
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCClauseKind
Represents the kind of an OpenACC clause.
If there is a current 'active' loop construct with a 'gang' clause on a 'kernel' construct,...
If there is a current 'active' loop construct that does NOT have a 'seq' clause on it,...