clang 22.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/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/DirectiveNameParser.h"
#include "llvm/Frontend/OpenMP/OMPAssume.h"
#include "llvm/Frontend/OpenMP/OMPContext.h"
#include <optional>
Go to the source code of this file.
This file implements parsing of all OpenMP directives and clauses.
Definition in file ParseOpenMP.cpp.
|
static |
Definition at line 905 of file ParseOpenMP.cpp.
References clang::Parser::Diag(), clang::OMPTraitProperty::Kind, clang::OMPTraitSelector::Kind, clang::OMPTraitSelector::Properties, and clang::OMPTraitProperty::RawString.
|
static |
Definition at line 59 of file ParseOpenMP.cpp.
References clang::Parser::Diag(), and clang::Parser::getLangOpts().
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 4028 of file ParseOpenMP.cpp.
References clang::Parser::getCurToken(), clang::Parser::getLangOpts(), clang::getOpenMPSimpleClauseType(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::OMPC_MAP_MODIFIER_unknown, and Tok.
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 4167 of file ParseOpenMP.cpp.
References clang::Parser::getCurToken(), clang::Parser::getLangOpts(), clang::getOpenMPSimpleClauseType(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::OMPC_MAP_unknown, and Tok.
Referenced by parseMapType(), and clang::Parser::parseMapTypeModifiers().
|
static |
Parse optional 'score' '(' <expr> ')' ':'.
Definition at line 1057 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().
|
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 658 of file ParseOpenMP.cpp.
References clang::SemaOpenMP::CheckOpenMPLinearModifier(), clang::Parser::ConsumeToken(), clang::Data, clang::Parser::Diag(), clang::Parser::getActions(), clang::Parser::getCurToken(), clang::Sema::getLangOpts(), clang::IdentifierInfo::getName(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OMPC_LINEAR_unknown, clang::Sema::OpenMP(), clang::Parser::ParseOpenMPParensExpr(), clang::Parser::ParseOpenMPVarList(), and Tok.
|
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 4185 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeToken(), clang::Data, clang::Parser::Diag(), clang::Parser::getCurToken(), isMapType(), clang::OMPC_MAP_unknown, and Tok.
Referenced by clang::Parser::ParseOpenMPVarList().
|
static |
Parse 'allocate' clause modifiers.
If allocator-modifier exists, return an expression for it. For both allocator and align modifiers, set Data fields as appropriate.
Definition at line 4349 of file ParseOpenMP.cpp.
References clang::BalancedDelimiterTracker::consumeClose(), clang::BalancedDelimiterTracker::consumeOpen(), clang::Parser::ConsumeToken(), clang::Data, clang::Parser::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Parser::getCurToken(), clang::Parser::getLangOpts(), clang::getOpenMPSimpleClauseType(), clang::getOpenMPSimpleClauseTypeName(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OMPC_ALLOCATE_unknown, clang::Parser::ParseAssignmentExpression(), clang::Parser::ParseOpenMPParensExpr(), and Tok.
Referenced by clang::Parser::ParseOpenMPVarList().
|
static |
Definition at line 74 of file ParseOpenMP.cpp.
References checkOpenMPDirectiveName(), clang::Parser::ConsumeToken(), clang::Parser::getCurToken(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::Preprocessor::LookAhead(), and Tok.
Referenced by clang::Parser::ParseOpenMPDeclareBeginVariantDirective().
|
static |
Definition at line 107 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeToken(), clang::ASTContext::DeclarationNames, clang::Parser::Diag(), clang::Parser::getActions(), clang::Sema::getASTContext(), clang::Parser::getCurToken(), clang::OO_None, clang::Parser::SkipUntil(), clang::Parser::StopBeforeMatch, and Tok.
|
static |
Definition at line 1732 of file ParseOpenMP.cpp.
References clang::Parser::ConsumeAnyToken(), clang::Parser::ConsumeToken(), clang::Parser::getCurToken(), clang::Parser::getLangOpts(), clang::getOpenMPSimpleClauseType(), clang::Parser::getPreprocessor(), clang::Preprocessor::getSpelling(), clang::T, and Tok.
|
static |
Definition at line 3979 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().
|
static |
Parse step size expression.
Returns true if parsing is successfull, otherwise returns false.
Definition at line 4328 of file ParseOpenMP.cpp.
References clang::Sema::ActOnFinishFullExpr(), clang::Data, clang::Parser::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Parser::getActions(), clang::Parser::getCurToken(), clang::Token::isNot(), clang::ActionResult< PtrTy, Compress >::isUsable(), and clang::Parser::ParseAssignmentExpression().
Referenced by clang::Parser::ParseOpenMPVarList().