clang
10.0.0git
|
This file implements parsing of all OpenMP directives and clauses. More...
#include "clang/AST/ASTContext.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Parse/ParseDiagnostic.h"
#include "clang/Parse/Parser.h"
#include "clang/Parse/RAIIObjectsForParser.h"
#include "clang/Sema/Scope.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/UniqueVector.h"
Go to the source code of this file.
Enumerations | |
enum | OpenMPDirectiveKindEx |
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. More... | |
static ExprResult | parseContextScore (Parser &P) |
Parse optional 'score' '(' <expr> ')' ':'. More... | |
static void | parseImplementationSelector (Parser &P, SourceLocation Loc, llvm::StringMap< SourceLocation > &UsedCtx, SmallVectorImpl< Sema::OMPCtxSelectorData > &Data) |
Parse context selector for 'implementation' selector set: 'vendor' '(' [ 'score' '(' <score _expr>=""> ')' ':' ] <vendor> { ',' <vendor> } ')'. More... | |
static void | parseDeviceSelector (Parser &P, SourceLocation Loc, llvm::StringMap< SourceLocation > &UsedCtx, SmallVectorImpl< Sema::OMPCtxSelectorData > &Data) |
Parse context selector for 'device' selector set: 'kind' '(' <kind> { ',' <kind> } ')'. More... | |
static 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. More... | |
static OpenMPMapClauseKind | isMapType (Parser &P) |
Checks if the token is a valid map-type. More... | |
static void | parseMapType (Parser &P, Parser::OpenMPVarListDataTy &Data) |
Parse map-type in map clause. More... | |
This file implements parsing of all OpenMP directives and clauses.
Definition in file ParseOpenMP.cpp.
Definition at line 31 of file ParseOpenMP.cpp.
|
static |
Definition at line 85 of file ParseOpenMP.cpp.
Referenced by parseOpenMPDirectiveKind().
|
static |
Checks if the token is a valid map-type-modifier.
Definition at line 2583 of file ParseOpenMP.cpp.
References clang::Parser::getCurToken(), clang::getOpenMPSimpleClauseType(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Token::is(), clang::OMPC_MAP_MODIFIER_unknown, and clang::format::Tok.
Referenced by clang::Parser::parseMapTypeModifiers().
|
static |
Checks if the token is a valid map-type.
Definition at line 2661 of file ParseOpenMP.cpp.
References clang::Parser::getCurToken(), clang::getOpenMPSimpleClauseType(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Token::isOneOf(), clang::OMPC_MAP_unknown, and clang::format::Tok.
Referenced by parseMapType().
|
static |
Parse optional 'score' '(' <expr> ')' ':'.
Definition at line 814 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeAnyToken(), clang::Parser::ConsumeToken(), clang::Parser::Diag(), clang::Parser::getCurToken(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Token::is(), and clang::Parser::ParseOpenMPParensExpr().
Referenced by parseImplementationSelector().
|
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 695 of file ParseOpenMP.cpp.
References clang::Sema::CheckOpenMPLinearModifier(), clang::Parser::ConsumeToken(), clang::Parser::OpenMPVarListDataTy::DepLinMapLastLoc, Diag(), clang::Parser::Diag(), clang::Parser::OpenMPVarListDataTy::ExtraModifier, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Parser::getActions(), clang::Parser::getCurToken(), clang::Token::getEndLoc(), clang::Token::getIdentifierInfo(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::getOpenMPClauseKind(), clang::Token::is(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Token::isNot(), clang::format::FormatToken::isNot(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::OMPC_LINEAR_unknown, clang::OMPC_uniform, clang::Parser::ParseOpenMPParensExpr(), clang::Parser::ParseOpenMPVarList(), clang::Parser::OpenMPVarListDataTy::TailExpr, and clang::format::Tok.
|
static |
Parse context selector for 'device' selector set: 'kind' '(' <kind> { ',' <kind> } ')'.
Definition at line 913 of file ParseOpenMP.cpp.
References clang::BalancedDelimiterTracker::consumeClose(), clang::Parser::ConsumeToken(), clang::Default, Diag(), clang::Parser::Diag(), clang::BalancedDelimiterTracker::expectAndConsume(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Parser::getCurToken(), clang::Token::getLocation(), clang::getOpenMPClauseKind(), clang::getOpenMPClauseName(), clang::getOpenMPContextSelector(), clang::getOpenMPContextSelectorSet(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Token::is(), clang::format::FormatToken::is(), clang::Token::isAnnotation(), clang::Token::isNot(), clang::format::FormatToken::isNot(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::OMP_CTX_SET_unknown, clang::OMP_CTX_unknown, clang::OMPC_match, clang::OMPC_unknown, parseImplementationSelector(), clang::Parser::SkipUntil(), clang::Parser::StopBeforeMatch, clang::format::Tok, clang::Parser::TryConsumeToken(), and clang::Sema::Unevaluated.
|
static |
Parse context selector for 'implementation' selector set: 'vendor' '(' [ 'score' '(' <score _expr>=""> ')' ':' ] <vendor> { ',' <vendor> } ')'.
Definition at line 837 of file ParseOpenMP.cpp.
References clang::BalancedDelimiterTracker::consumeClose(), clang::Parser::ConsumeToken(), clang::Parser::Diag(), clang::BalancedDelimiterTracker::expectAndConsume(), clang::Parser::getCurToken(), clang::Token::getLocation(), clang::getOpenMPContextSelector(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Token::is(), clang::Token::isNot(), clang::OMP_CTX_unknown, parseContextScore(), clang::Parser::SkipUntil(), clang::Parser::StopBeforeMatch, clang::format::Tok, and clang::Parser::TryConsumeToken().
Referenced by parseDeviceSelector().
|
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 2675 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeToken(), clang::Parser::Diag(), clang::Parser::OpenMPVarListDataTy::ExtraModifier, clang::Parser::getCurToken(), clang::Token::is(), isMapType(), clang::OMPC_MAP_unknown, and clang::format::Tok.
Referenced by clang::Parser::ParseOpenMPVarList().
|
static |
Definition at line 105 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeToken(), clang::Parser::getCurToken(), getOpenMPDirectiveKindEx(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Token::isAnnotation(), clang::Preprocessor::LookAhead(), and clang::format::Tok.
Referenced by clang::Parser::ParseOpenMPParensExpr().
|
static |
Definition at line 191 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeToken(), clang::ASTContext::DeclarationNames, clang::Parser::Diag(), clang::BalancedDelimiterTracker::expectAndConsume(), clang::Parser::getActions(), clang::Sema::getASTContext(), clang::Parser::getCurToken(), clang::Token::getIdentifierInfo(), clang::Token::getKind(), clang::Token::getLocation(), clang::Token::is(), clang::OO_None, clang::Parser::SkipUntil(), clang::Parser::StopBeforeMatch, and clang::format::Tok.
|
static |
Definition at line 1181 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeAnyToken(), clang::BalancedDelimiterTracker::consumeClose(), clang::Parser::ConsumeToken(), Diag(), clang::BalancedDelimiterTracker::expectAndConsume(), clang::BalancedDelimiterTracker::getCloseLocation(), clang::Parser::getCurToken(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::getOpenMPClauseKind(), clang::getOpenMPClauseName(), clang::getOpenMPSimpleClauseType(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::format::FormatToken::is(), clang::Token::isAnnotation(), clang::Token::isNot(), clang::format::FormatToken::isNot(), clang::SourceLocation::isValid(), clang::None, clang::OMPC_device_type, clang::OMPC_DEVICE_TYPE_unknown, and clang::format::Tok.
Referenced by clang::Parser::ParseOpenMPParensExpr().
|
static |
Definition at line 2536 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeToken(), clang::Parser::getCurToken(), clang::Token::getKind(), clang::CXXScopeSpec::isEmpty(), clang::OO_None, clang::Parser::ParseUnqualifiedId(), and clang::UnqualifiedId::setOperatorFunctionId().
Referenced by clang::Parser::ParseOpenMPVarList().