clang  14.0.0git
Functions
ParseOpenMP.cpp File Reference
#include "clang/AST/ASTContext.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TokenKinds.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/StringSwitch.h"
#include "llvm/ADT/UniqueVector.h"
#include "llvm/Frontend/OpenMP/OMPContext.h"
Include dependency graph for ParseOpenMP.cpp:

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. More...
 
static bool checkExtensionProperty (Parser &P, SourceLocation Loc, OMPTraitProperty &TIProperty, OMPTraitSelector &TISelector, llvm::StringMap< SourceLocation > &Seen)
 
static ExprResult parseContextScore (Parser &P)
 Parse optional 'score' '(' <expr> ')' ':'. More...
 
static Optional< OMPDeclareVariantAttr::InteropType > parseInteropTypeList (Parser &P)
 Parse a list of interop-types. 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...
 

Detailed Description

This file implements parsing of all OpenMP directives and clauses.

Definition in file ParseOpenMP.cpp.

Function Documentation

◆ checkExtensionProperty()

static bool checkExtensionProperty ( Parser P,
SourceLocation  Loc,
OMPTraitProperty TIProperty,
OMPTraitSelector TISelector,
llvm::StringMap< SourceLocation > &  Seen 
)
static

◆ getOpenMPDirectiveKindEx()

static unsigned getOpenMPDirectiveKindEx ( StringRef  S)
static

Definition at line 98 of file ParseOpenMP.cpp.

Referenced by parseOpenMPDirectiveKind().

◆ isMapModifier()

static OpenMPMapModifierKind isMapModifier ( Parser P)
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 3782 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().

◆ isMapType()

static OpenMPMapClauseKind isMapType ( Parser P)
static

Checks if the token is a valid map-type.

FIXME: It will return an OpenMPMapModifierKind if that's what it parses.

Definition at line 3868 of file ParseOpenMP.cpp.

References clang::getOpenMPSimpleClauseType(), clang::Preprocessor::getSpelling(), clang::Token::isOneOf(), clang::OMPC_MAP_unknown, and P.

Referenced by parseMapType().

◆ parseContextScore()

static ExprResult parseContextScore ( Parser P)
static

Parse optional 'score' '(' <expr> ')' ':'.

Definition at line 1084 of file ParseOpenMP.cpp.

References P.

◆ parseDeclareSimdClauses()

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 
)
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 702 of file ParseOpenMP.cpp.

References clang::Parser::OpenMPVarListDataTy::DepModOrTailExpr, clang::Parser::OpenMPVarListDataTy::ExtraModifier, clang::Parser::OpenMPVarListDataTy::ExtraModifierLoc, clang::Token::getEndLoc(), clang::Token::getIdentifierInfo(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::Token::is(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Token::isNot(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::OMPC_LINEAR_unknown, and P.

◆ parseInteropTypeList()

static Optional<OMPDeclareVariantAttr::InteropType> parseInteropTypeList ( Parser P)
static

Parse a list of interop-types.

These are 'target' and 'targetsync'. Both are allowed but duplication of either is not meaningful.

Definition at line 1493 of file ParseOpenMP.cpp.

References clang::Token::getIdentifierInfo(), clang::Token::is(), clang::IdentifierInfo::isStr(), and P.

◆ parseMapType()

static void parseMapType ( Parser P,
Parser::OpenMPVarListDataTy Data 
)
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 3883 of file ParseOpenMP.cpp.

References clang::Parser::OpenMPVarListDataTy::ExtraModifier, clang::Token::is(), isMapType(), clang::OMPC_MAP_unknown, and P.

Referenced by clang::Parser::ParseOpenMPVarList().

◆ parseOpenMPDirectiveKind()

static OpenMPDirectiveKindExWrapper parseOpenMPDirectiveKind ( Parser P)
static

Definition at line 119 of file ParseOpenMP.cpp.

References getOpenMPDirectiveKindEx(), clang::Token::isAnnotation(), and P.

◆ parseOpenMPReductionId()

static DeclarationName parseOpenMPReductionId ( Parser P)
static

◆ parseOpenMPSimpleClause()

static Optional<SimpleClauseData> parseOpenMPSimpleClause ( Parser P,
OpenMPClauseKind  Kind 
)
static

◆ ParseReductionId()

static bool ParseReductionId ( Parser P,
CXXScopeSpec ReductionIdScopeSpec,
UnqualifiedId ReductionId 
)
static