clang  14.0.0git
Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::OMPMapClause Class Referencefinal

This represents clause 'map' in the '#pragma omp ...' directives. More...

#include "clang/AST/OpenMPClause.h"

Inheritance diagram for clang::OMPMapClause:
Inheritance graph
[legend]
Collaboration diagram for clang::OMPMapClause:
Collaboration graph
[legend]

Public Member Functions

OpenMPMapClauseKind getMapType () const LLVM_READONLY
 Fetches mapping kind for the clause. More...
 
bool isImplicitMapType () const LLVM_READONLY
 Is this an implicit map type? We have to capture 'IsMapTypeImplicit' from the parser for more informative error messages. More...
 
OpenMPMapModifierKind getMapTypeModifier (unsigned Cnt) const LLVM_READONLY
 Fetches the map-type-modifier at 'Cnt' index of array of modifiers. More...
 
SourceLocation getMapTypeModifierLoc (unsigned Cnt) const LLVM_READONLY
 Fetches the map-type-modifier location at 'Cnt' index of array of modifiers' locations. More...
 
ArrayRef< OpenMPMapModifierKindgetMapTypeModifiers () const LLVM_READONLY
 Fetches ArrayRef of map-type-modifiers. More...
 
ArrayRef< SourceLocationgetMapTypeModifiersLoc () const LLVM_READONLY
 Fetches ArrayRef of location of map-type-modifiers. More...
 
SourceLocation getMapLoc () const LLVM_READONLY
 Fetches location of clause mapping kind. More...
 
SourceLocation getColonLoc () const
 Get colon location. More...
 
child_range children ()
 
const_child_range children () const
 
child_range used_children ()
 
const_child_range used_children () const
 
- Public Member Functions inherited from clang::OMPMappableExprListClause< OMPMapClause >
unsigned getUniqueDeclarationsNum () const
 Return the number of unique base declarations in this clause. More...
 
unsigned getTotalComponentListNum () const
 Return the number of lists derived from the clause expressions. More...
 
unsigned getTotalComponentsNum () const
 Return the total number of components in all lists derived from the clause. More...
 
NestedNameSpecifierLoc getMapperQualifierLoc () const
 Gets the nested name specifier for associated user-defined mapper. More...
 
const DeclarationNameInfogetMapperIdInfo () const
 Gets the name info for associated user-defined mapper. More...
 
const_component_lists_iterator component_lists_begin () const
 Iterators for all component lists. More...
 
const_component_lists_iterator component_lists_end () const
 
const_component_lists_range component_lists () const
 
const_component_lists_iterator decl_component_lists_begin (const ValueDecl *VD) const
 Iterators for component lists associated with the provided declaration. More...
 
const_component_lists_iterator decl_component_lists_end () const
 
const_component_lists_range decl_component_lists (const ValueDecl *VD) const
 
const_all_decls_range all_decls () const
 
const_all_num_lists_range all_num_lists () const
 
const_all_lists_sizes_range all_lists_sizes () const
 
const_all_components_range all_components () const
 
mapperlist_iterator mapperlist_begin ()
 
mapperlist_const_iterator mapperlist_begin () const
 
mapperlist_iterator mapperlist_end ()
 
mapperlist_const_iterator mapperlist_end () const
 
mapperlist_range mapperlists ()
 
mapperlist_const_range mapperlists () const
 
- Public Member Functions inherited from clang::OMPVarListClause< OMPMapClause >
ArrayRef< const Expr * > getVarRefs () const
 Fetches list of all variables in the clause. More...
 
unsigned varlist_size () const
 
bool varlist_empty () const
 
varlist_range varlists ()
 
varlist_const_range varlists () const
 
varlist_iterator varlist_begin ()
 
varlist_const_iterator varlist_begin () const
 
varlist_iterator varlist_end ()
 
varlist_const_iterator varlist_end () const
 
void setLParenLoc (SourceLocation Loc)
 Sets the location of '('. More...
 
SourceLocation getLParenLoc () const
 Returns the location of '('. More...
 
- Public Member Functions inherited from clang::OMPClause
SourceLocation getBeginLoc () const
 Returns the starting location of the clause. More...
 
SourceLocation getEndLoc () const
 Returns the ending location of the clause. More...
 
void setLocStart (SourceLocation Loc)
 Sets the starting location of the clause. More...
 
void setLocEnd (SourceLocation Loc)
 Sets the ending location of the clause. More...
 
OpenMPClauseKind getClauseKind () const
 Returns kind of OpenMP clause (private, shared, reduction, etc.). More...
 
bool isImplicit () const
 
child_range children ()
 
const_child_range children () const
 
child_range used_children ()
 Get the iterator range for the expressions used in the clauses. More...
 
const_child_range used_children () const
 

Static Public Member Functions

static OMPMapClauseCreate (const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef< Expr * > Vars, ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< Expr * > UDMapperRefs, ArrayRef< OpenMPMapModifierKind > MapModifiers, ArrayRef< SourceLocation > MapModifiersLoc, NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId, OpenMPMapClauseKind Type, bool TypeIsImplicit, SourceLocation TypeLoc)
 Creates clause with a list of variables VL. More...
 
static OMPMapClauseCreateEmpty (const ASTContext &C, const OMPMappableExprListSizeTy &Sizes)
 Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declarations, \NumComponentLists lists, and NumComponents expression components. More...
 
static bool classof (const OMPClause *T)
 
- Static Public Member Functions inherited from clang::OMPClause
static bool classof (const OMPClause *)
 

Friends

class OMPClauseReader
 

Additional Inherited Members

- Public Types inherited from clang::OMPMappableExprListClause< OMPMapClause >
using const_component_lists_range = llvm::iterator_range< const_component_lists_iterator >
 
using const_all_decls_iterator = ArrayRef< ValueDecl * >::iterator
 Iterators to access all the declarations, number of lists, list sizes, and components. More...
 
using const_all_decls_range = llvm::iterator_range< const_all_decls_iterator >
 
using const_all_num_lists_iterator = ArrayRef< unsigned >::iterator
 
using const_all_num_lists_range = llvm::iterator_range< const_all_num_lists_iterator >
 
using const_all_lists_sizes_iterator = ArrayRef< unsigned >::iterator
 
using const_all_lists_sizes_range = llvm::iterator_range< const_all_lists_sizes_iterator >
 
using const_all_components_iterator = ArrayRef< MappableComponent >::iterator
 
using const_all_components_range = llvm::iterator_range< const_all_components_iterator >
 
using mapperlist_iterator = MutableArrayRef< Expr * >::iterator
 
using mapperlist_const_iterator = ArrayRef< const Expr * >::iterator
 
using mapperlist_range = llvm::iterator_range< mapperlist_iterator >
 
using mapperlist_const_range = llvm::iterator_range< mapperlist_const_iterator >
 
- Public Types inherited from clang::OMPVarListClause< OMPMapClause >
using varlist_iterator = MutableArrayRef< Expr * >::iterator
 
using varlist_const_iterator = ArrayRef< const Expr * >::iterator
 
using varlist_range = llvm::iterator_range< varlist_iterator >
 
using varlist_const_range = llvm::iterator_range< varlist_const_iterator >
 
- Public Types inherited from clang::OMPClause
using child_iterator = StmtIterator
 
using const_child_iterator = ConstStmtIterator
 
using child_range = llvm::iterator_range< child_iterator >
 
using const_child_range = llvm::iterator_range< const_child_iterator >
 
- Public Types inherited from clang::OMPClauseMappableExprCommon
using MappableExprComponentList = SmallVector< MappableComponent, 8 >
 
using MappableExprComponentListRef = ArrayRef< MappableComponent >
 
using MappableExprComponentLists = SmallVector< MappableExprComponentList, 8 >
 
using MappableExprComponentListsRef = ArrayRef< MappableExprComponentList >
 
- Protected Member Functions inherited from clang::OMPMappableExprListClause< OMPMapClause >
 OMPMappableExprListClause (OpenMPClauseKind K, const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes, bool SupportsMapper=false, NestedNameSpecifierLoc *MapperQualifierLocPtr=nullptr, DeclarationNameInfo *MapperIdInfoPtr=nullptr)
 Build a clause for NumUniqueDeclarations declarations, NumComponentLists total component lists, and NumComponents total components. More...
 
MutableArrayRef< ValueDecl * > getUniqueDeclsRef ()
 Get the unique declarations that are in the trailing objects of the class. More...
 
ArrayRef< ValueDecl * > getUniqueDeclsRef () const
 Get the unique declarations that are in the trailing objects of the class. More...
 
void setUniqueDecls (ArrayRef< ValueDecl * > UDs)
 Set the unique declarations that are in the trailing objects of the class. More...
 
MutableArrayRef< unsignedgetDeclNumListsRef ()
 Get the number of lists per declaration that are in the trailing objects of the class. More...
 
ArrayRef< unsignedgetDeclNumListsRef () const
 Get the number of lists per declaration that are in the trailing objects of the class. More...
 
void setDeclNumLists (ArrayRef< unsigned > DNLs)
 Set the number of lists per declaration that are in the trailing objects of the class. More...
 
MutableArrayRef< unsignedgetComponentListSizesRef ()
 Get the cumulative component lists sizes that are in the trailing objects of the class. More...
 
ArrayRef< unsignedgetComponentListSizesRef () const
 Get the cumulative component lists sizes that are in the trailing objects of the class. More...
 
void setComponentListSizes (ArrayRef< unsigned > CLSs)
 Set the cumulative component lists sizes that are in the trailing objects of the class. More...
 
MutableArrayRef< MappableComponentgetComponentsRef ()
 Get the components that are in the trailing objects of the class. More...
 
ArrayRef< MappableComponentgetComponentsRef () const
 Get the components that are in the trailing objects of the class. More...
 
void setComponents (ArrayRef< MappableComponent > Components, ArrayRef< unsigned > CLSs)
 Set the components that are in the trailing objects of the class. More...
 
void setClauseInfo (ArrayRef< ValueDecl * > Declarations, MappableExprComponentListsRef ComponentLists)
 Fill the clause information from the list of declarations and associated component lists. More...
 
void setMapperQualifierLoc (NestedNameSpecifierLoc NNSL)
 Set the nested name specifier of associated user-defined mapper. More...
 
void setMapperIdInfo (DeclarationNameInfo MapperId)
 Set the name of associated user-defined mapper. More...
 
MutableArrayRef< Expr * > getUDMapperRefs ()
 Get the user-defined mapper references that are in the trailing objects of the class. More...
 
ArrayRef< Expr * > getUDMapperRefs () const
 Get the user-defined mappers references that are in the trailing objects of the class. More...
 
void setUDMapperRefs (ArrayRef< Expr * > DMDs)
 Set the user-defined mappers that are in the trailing objects of the class. More...
 
- Protected Member Functions inherited from clang::OMPVarListClause< OMPMapClause >
 OMPVarListClause (OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
 Build a clause with N variables. More...
 
MutableArrayRef< Expr * > getVarRefs ()
 Fetches list of variables associated with this clause. More...
 
void setVarRefs (ArrayRef< Expr * > VL)
 Sets the list of variables for this clause. More...
 
- Protected Member Functions inherited from clang::OMPClause
 OMPClause (OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
 
- Static Protected Member Functions inherited from clang::OMPClauseMappableExprCommon
static unsigned getComponentsTotalNumber (MappableExprComponentListsRef ComponentLists)
 
static unsigned getUniqueDeclarationsTotalNumber (ArrayRef< const ValueDecl * > Declarations)
 

Detailed Description

This represents clause 'map' in the '#pragma omp ...' directives.

#pragma omp target map(a,b)

In this example directive '#pragma omp target' has clause 'map' with the variables 'a' and 'b'.

Definition at line 5582 of file OpenMPClause.h.

Member Function Documentation

◆ children() [1/2]

child_range clang::OMPMapClause::children ( )
inline

◆ children() [2/2]

const_child_range clang::OMPMapClause::children ( ) const
inline

Definition at line 5806 of file OpenMPClause.h.

References children().

◆ classof()

static bool clang::OMPMapClause::classof ( const OMPClause T)
inlinestatic

Definition at line 5823 of file OpenMPClause.h.

References clang::OMPClause::getClauseKind().

◆ Create()

OMPMapClause * OMPMapClause::Create ( const ASTContext C,
const OMPVarListLocTy Locs,
ArrayRef< Expr * >  Vars,
ArrayRef< ValueDecl * >  Declarations,
MappableExprComponentListsRef  ComponentLists,
ArrayRef< Expr * >  UDMapperRefs,
ArrayRef< OpenMPMapModifierKind MapModifiers,
ArrayRef< SourceLocation MapModifiersLoc,
NestedNameSpecifierLoc  UDMQualifierLoc,
DeclarationNameInfo  MapperId,
OpenMPMapClauseKind  Type,
bool  TypeIsImplicit,
SourceLocation  TypeLoc 
)
static

Creates clause with a list of variables VL.

Parameters
CAST context.
LocsLocations needed to build a mappable clause. It includes 1) StartLoc: starting location of the clause (the clause keyword); 2) LParenLoc: location of '('; 3) EndLoc: ending location of the clause.
VarsThe original expression used in the clause.
DeclarationsDeclarations used in the clause.
ComponentListsComponent lists used in the clause.
UDMapperRefsReferences to user-defined mappers associated with expressions used in the clause.
MapModifiersMap-type-modifiers.
MapModifiersLocLocation of map-type-modifiers.
UDMQualifierLocC++ nested name specifier for the associated user-defined mapper.
MapperIdThe identifier of associated user-defined mapper.
TypeMap type.
TypeIsImplicitMap type is inferred implicitly.
TypeLocLocation of the map type.

Definition at line 1113 of file OpenMPClause.cpp.

References clang::OMPMappableExprListSizeTy::NumComponentLists, clang::OMPMappableExprListSizeTy::NumComponents, clang::OMPMappableExprListSizeTy::NumUniqueDeclarations, clang::OMPMappableExprListSizeTy::NumVars, clang::OMPMappableExprListClause< T >::setClauseInfo(), clang::OMPMappableExprListClause< T >::setUDMapperRefs(), and clang::OMPVarListClause< T >::setVarRefs().

Referenced by clang::Sema::ActOnOpenMPMapClause().

◆ CreateEmpty()

OMPMapClause * OMPMapClause::CreateEmpty ( const ASTContext C,
const OMPMappableExprListSizeTy Sizes 
)
static

Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declarations, \NumComponentLists lists, and NumComponents expression components.

Parameters
CAST context.
SizesAll required sizes to build a mappable clause. It includes 1) NumVars: number of expressions listed in this clause; 2) NumUniqueDeclarations: number of unique base declarations in this clause; 3) NumComponentLists: number of component lists in this clause; and 4) NumComponents: total number of expression components in the clause.

Definition at line 1156 of file OpenMPClause.cpp.

References clang::OMPMappableExprListSizeTy::NumComponentLists, clang::OMPMappableExprListSizeTy::NumComponents, clang::OMPMappableExprListSizeTy::NumUniqueDeclarations, and clang::OMPMappableExprListSizeTy::NumVars.

Referenced by clang::OMPClauseReader::readClause().

◆ getColonLoc()

SourceLocation clang::OMPMapClause::getColonLoc ( ) const
inline

Get colon location.

Definition at line 5798 of file OpenMPClause.h.

◆ getMapLoc()

SourceLocation clang::OMPMapClause::getMapLoc ( ) const
inline

Fetches location of clause mapping kind.

Definition at line 5795 of file OpenMPClause.h.

◆ getMapType()

OpenMPMapClauseKind clang::OMPMapClause::getMapType ( ) const
inline

Fetches mapping kind for the clause.

Definition at line 5756 of file OpenMPClause.h.

◆ getMapTypeModifier()

OpenMPMapModifierKind clang::OMPMapClause::getMapTypeModifier ( unsigned  Cnt) const
inline

Fetches the map-type-modifier at 'Cnt' index of array of modifiers.

Parameters
Cntindex for map-type-modifier.

Definition at line 5768 of file OpenMPClause.h.

References clang::NumberOfOMPMapClauseModifiers.

◆ getMapTypeModifierLoc()

SourceLocation clang::OMPMapClause::getMapTypeModifierLoc ( unsigned  Cnt) const
inline

Fetches the map-type-modifier location at 'Cnt' index of array of modifiers' locations.

Parameters
Cntindex for map-type-modifier location.

Definition at line 5778 of file OpenMPClause.h.

References clang::NumberOfOMPMapClauseModifiers.

◆ getMapTypeModifiers()

ArrayRef<OpenMPMapModifierKind> clang::OMPMapClause::getMapTypeModifiers ( ) const
inline

Fetches ArrayRef of map-type-modifiers.

Definition at line 5785 of file OpenMPClause.h.

◆ getMapTypeModifiersLoc()

ArrayRef<SourceLocation> clang::OMPMapClause::getMapTypeModifiersLoc ( ) const
inline

Fetches ArrayRef of location of map-type-modifiers.

Definition at line 5790 of file OpenMPClause.h.

◆ isImplicitMapType()

bool clang::OMPMapClause::isImplicitMapType ( ) const
inline

Is this an implicit map type? We have to capture 'IsMapTypeImplicit' from the parser for more informative error messages.

It helps distinguish map(r) from map(tofrom: r), which is important to print more helpful error messages for some target directives.

Definition at line 5763 of file OpenMPClause.h.

◆ used_children() [1/2]

child_range clang::OMPMapClause::used_children ( )
inline

◆ used_children() [2/2]

const_child_range clang::OMPMapClause::used_children ( ) const
inline

Definition at line 5817 of file OpenMPClause.h.

References used_children().

Friends And Related Function Documentation

◆ OMPClauseReader

friend class OMPClauseReader
friend

Definition at line 5586 of file OpenMPClause.h.


The documentation for this class was generated from the following files: