clang 20.0.0git
|
This file implements parsing of all OpenMP directives and clauses. More...
#include "clang/AST/ASTContext.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/Basic/DiagnosticParse.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Parse/Parser.h"
#include "clang/Parse/RAIIObjectsForParser.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/SemaAMDGPU.h"
#include "clang/Sema/SemaCodeCompletion.h"
#include "clang/Sema/SemaOpenMP.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Frontend/OpenMP/OMPAssume.h"
#include "llvm/Frontend/OpenMP/OMPContext.h"
#include <optional>
Go to the source code of this file.
Functions | |
static unsigned | getOpenMPDirectiveKindEx (StringRef S) |
static OpenMPDirectiveKindExWrapper | parseOpenMPDirectiveKind (Parser &P) |
static DeclarationName | parseOpenMPReductionId (Parser &P) |
static bool | parseDeclareSimdClauses (Parser &P, OMPDeclareSimdDeclAttr::BranchStateTy &BS, ExprResult &SimdLen, SmallVectorImpl< Expr * > &Uniforms, SmallVectorImpl< Expr * > &Aligneds, SmallVectorImpl< Expr * > &Alignments, SmallVectorImpl< Expr * > &Linears, SmallVectorImpl< unsigned > &LinModifiers, SmallVectorImpl< Expr * > &Steps) |
Parses clauses for 'declare simd' directive. | |
static bool | checkExtensionProperty (Parser &P, SourceLocation Loc, OMPTraitProperty &TIProperty, OMPTraitSelector &TISelector, llvm::StringMap< SourceLocation > &Seen) |
static ExprResult | parseContextScore (Parser &P) |
Parse optional 'score' '(' <expr> ')' ':'. | |
static std::optional< SimpleClauseData > | parseOpenMPSimpleClause (Parser &P, OpenMPClauseKind Kind) |
static bool | ParseReductionId (Parser &P, CXXScopeSpec &ReductionIdScopeSpec, UnqualifiedId &ReductionId) |
static OpenMPMapModifierKind | isMapModifier (Parser &P) |
Checks if the token is a valid map-type-modifier. | |
static OpenMPMapClauseKind | isMapType (Parser &P) |
Checks if the token is a valid map-type. | |
static void | parseMapType (Parser &P, SemaOpenMP::OpenMPVarListDataTy &Data) |
Parse map-type in map clause. | |
static bool | parseStepSize (Parser &P, SemaOpenMP::OpenMPVarListDataTy &Data, OpenMPClauseKind CKind, SourceLocation ELoc) |
Parse step size expression. | |
static ExprResult | parseOpenMPAllocateClauseModifiers (Parser &P, OpenMPClauseKind Kind, SemaOpenMP::OpenMPVarListDataTy &Data) |
Parse 'allocate' clause modifiers. | |
This file implements parsing of all OpenMP directives and clauses.
Definition in file ParseOpenMP.cpp.
|
static |
Definition at line 955 of file ParseOpenMP.cpp.
References clang::OMPTraitProperty::Kind, clang::OMPTraitSelector::Kind, Loc, P, clang::OMPTraitSelector::Properties, and clang::OMPTraitProperty::RawString.
|
static |
Definition at line 103 of file ParseOpenMP.cpp.
Referenced by parseOpenMPDirectiveKind().
|
static |
Checks if the token is a valid map-type-modifier.
FIXME: It will return an OpenMPMapClauseKind if that's what it parses.
Definition at line 4219 of file ParseOpenMP.cpp.
References clang::getOpenMPSimpleClauseType(), clang::Preprocessor::getSpelling(), clang::Token::is(), clang::OMPC_MAP_MODIFIER_unknown, and P.
Referenced by clang::Parser::parseMapTypeModifiers().
|
static |
Checks if the token is a valid map-type.
If it is not MapType kind, OMPC_MAP_unknown is returned.
Definition at line 4349 of file ParseOpenMP.cpp.
References clang::getOpenMPSimpleClauseType(), clang::Preprocessor::getSpelling(), clang::Token::isOneOf(), clang::OMPC_MAP_unknown, and P.
Referenced by parseMapType(), and clang::Parser::parseMapTypeModifiers().
|
static |
Parse optional 'score' '(' <expr> ')' ':'.
Definition at line 1107 of file ParseOpenMP.cpp.
References P.
|
static |
Parses clauses for 'declare simd' directive.
clause: 'inbranch' | 'notinbranch' 'simdlen' '(' <expr> ')' { 'uniform' '(' <argument_list> ')' } { 'aligned '(' <argument_list> [ ':' <alignment> ] ')' } { 'linear '(' <argument_list> [ ':' <step> ] ')' }
Definition at line 721 of file ParseOpenMP.cpp.
References clang::Data, clang::Token::getEndLoc(), clang::Token::getIdentifierInfo(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::Token::is(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Token::isNot(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OMPC_LINEAR_unknown, and P.
|
static |
Parse map-type in map clause.
map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list) where, map-type ::= to | from | tofrom | alloc | release | delete
Definition at line 4367 of file ParseOpenMP.cpp.
References clang::Data, clang::Token::is(), isMapType(), clang::OMPC_MAP_unknown, and P.
Referenced by clang::Parser::ParseOpenMPVarList().
|
static |
Parse 'allocate' clause modifiers.
If allocator-modifier exists, return an expression for it and set Data field noting modifier was specified.
Definition at line 4537 of file ParseOpenMP.cpp.
References clang::BalancedDelimiterTracker::consumeClose(), clang::BalancedDelimiterTracker::consumeOpen(), clang::Data, clang::getOpenMPSimpleClauseType(), clang::Preprocessor::getSpelling(), clang::Token::is(), and P.
Referenced by clang::Parser::ParseOpenMPVarList().
|
static |
Definition at line 124 of file ParseOpenMP.cpp.
References getOpenMPDirectiveKindEx(), clang::Token::isAnnotation(), and P.
|
static |
Definition at line 227 of file ParseOpenMP.cpp.
References clang::ASTContext::DeclarationNames, clang::Sema::getASTContext(), clang::Token::getIdentifierInfo(), clang::Token::getKind(), clang::Token::getLocation(), clang::Token::is(), clang::OO_None, P, and clang::Parser::StopBeforeMatch.
|
static |
Definition at line 1797 of file ParseOpenMP.cpp.
References clang::Token::getLocation(), clang::getOpenMPSimpleClauseType(), clang::Token::isAnnotation(), clang::Token::isNot(), Loc, P, and clang::T.
|
static |
Definition at line 4170 of file ParseOpenMP.cpp.
References clang::CXXScopeSpec::isEmpty(), clang::OO_None, P, and clang::UnqualifiedId::setOperatorFunctionId().
Referenced by clang::Parser::ParseOpenMPVarList().
|
static |
Parse step size expression.
Returns true if parsing is successfull, otherwise returns false.
Definition at line 4515 of file ParseOpenMP.cpp.
References clang::Sema::ActOnFinishFullExpr(), clang::Data, clang::ActionResult< PtrTy, Compress >::get(), clang::Token::isNot(), clang::ActionResult< PtrTy, Compress >::isUsable(), and P.
Referenced by clang::Parser::ParseOpenMPVarList().