clang 8.0.0

Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
OMPMapClause Class Referencefinal

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

`#include "clang/AST/OpenMPClause.h"`

Inheritance diagram for OMPMapClause:
[legend]
Collaboration diagram for OMPMapClause:
[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< OpenMPMapModifierKind > | getMapTypeModifiers () const LLVM_READONLY
| Fetches ArrayRef of map-type-modifiers. More...
ArrayRef< SourceLocation > | getMapTypeModifiersLoc () 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 ()
Public Member Functions inherited from 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...
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

## Static Public Member Functions
static OMPMapClause * | Create (const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr *> Vars, ArrayRef< ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists, ArrayRef< OpenMPMapModifierKind > MapModifiers, ArrayRef< SourceLocation > MapModifiersLoc, OpenMPMapClauseKind Type, bool TypeIsImplicit, SourceLocation TypeLoc)
| Creates clause with a list of variables VL. More...
static OMPMapClause * | CreateEmpty (const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
| Creates an empty clause with the place for NumVars original expressions, NumUniqueDeclarations declarations, lists, and NumComponents expression components. More...
static bool | classof (const OMPClause *T)

## Static Public Attributes
static constexpr unsigned | NumberOfModifiers
| Number of allowed map-type-modifiers. More...

## Friends
class | OMPClauseReader

## Additional Inherited Members
Public Types inherited from 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 >
Public Types inherited from OMPClauseMappableExprCommon
using | MappableExprComponentList = SmallVector< MappableComponent, 8 >
using | MappableExprComponentListRef = ArrayRef< MappableComponent >
using | MappableExprComponentLists = SmallVector< MappableExprComponentList, 8 >
using | MappableExprComponentListsRef = ArrayRef< MappableExprComponentList >
Protected Member Functions inherited from OMPMappableExprListClause< OMPMapClause >
| OMPMappableExprListClause (OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned NumVars, unsigned NumUniqueDeclarations, unsigned NumComponentLists, unsigned NumComponents)
| 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< unsigned > | getDeclNumListsRef ()
| Get the number of lists per declaration that are in the trailing objects of the class. More...
ArrayRef< unsigned > | getDeclNumListsRef () 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< unsigned > | getComponentListSizesRef ()
| Get the cumulative component lists sizes that are in the trailing objects of the class. More...
ArrayRef< unsigned > | getComponentListSizesRef () 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< MappableComponent > | getComponentsRef ()
| Get the components that are in the trailing objects of the class. More...
ArrayRef< MappableComponent > | getComponentsRef () 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...
Static Protected Member Functions inherited from 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 4043 of file OpenMPClause.h.

## Member Function Documentation

## ◆ children()

child_range OMPMapClause::children | ( |  | ) |
| inline

Definition at line 4259 of file OpenMPClause.h.

## ◆ classof()

static bool OMPMapClause::classof | ( | const OMPClause * | T | ) |
| inline static

Definition at line 4265 of file OpenMPClause.h.

## ◆ Create()

OMPMapClause * OMPMapClause::Create | ( | const ASTContext & | C,
|  | SourceLocation | StartLoc,
|  | SourceLocation | LParenLoc,
|  | SourceLocation | EndLoc,
|  | ArrayRef< Expr *> | Vars,
|  | ArrayRef< ValueDecl *> | Declarations,
|  | MappableExprComponentListsRef | ComponentLists,
|  | ArrayRef< OpenMPMapModifierKind > | MapModifiers,
|  | ArrayRef< SourceLocation > | MapModifiersLoc,
|  | OpenMPMapClauseKind | Type,
|  | bool | TypeIsImplicit,
|  | SourceLocation | TypeLoc
| ) |  |
| static

Creates clause with a list of variables VL.

Parameters

  C | AST context.
  StartLoc | Starting location of the clause.
  EndLoc | Ending location of the clause.
  Vars | The original expression used in the clause.
  Declarations | Declarations used in the clause.
  ComponentLists | Component lists used in the clause.
  MapModifiers | Map-type-modifiers.
  MapModifiersLoc | Location of map-type-modifiers.
  Type | Map type.
  TypeIsImplicit | Map type is inferred implicitly.
  TypeLoc | Location of the map type.

Definition at line 795 of file OpenMPClause.cpp.

References clang::ASTContext::Allocate(), and OMPMappableExprListClause< T >::setClauseInfo().

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

## ◆ CreateEmpty()

OMPMapClause * OMPMapClause::CreateEmpty | ( | const ASTContext & | C,
|  | unsigned | NumVars,
|  | unsigned | NumUniqueDeclarations,
|  | unsigned | NumComponentLists,
|  | unsigned | NumComponents
| ) |  |
| static

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

Parameters

  C | AST context.
  NumVars | Number of expressions listed in the clause.
  NumUniqueDeclarations | Number of unique base declarations in this clause.
  NumComponentLists | Number of unique base declarations in this clause.
  NumComponents | Total number of expression components in the clause.

Definition at line 836 of file OpenMPClause.cpp.

References clang::ASTContext::Allocate().

## ◆ getColonLoc()

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

Get colon location.

Definition at line 4257 of file OpenMPClause.h.

References ColonLoc.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getMapLoc()

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

Fetches location of clause mapping kind.

Definition at line 4254 of file OpenMPClause.h.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getMapType()

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

Fetches mapping kind for the clause.

Definition at line 4215 of file OpenMPClause.h.

Referenced by OMPIsDevicePtrClause::CreateEmpty(), clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getMapTypeModifier()

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

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

Parameters

  Cnt | index for map-type-modifier.

Definition at line 4227 of file OpenMPClause.h.

Referenced by OMPIsDevicePtrClause::CreateEmpty(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getMapTypeModifierLoc()

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

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

Parameters

  Cnt | index for map-type-modifier location.

Definition at line 4237 of file OpenMPClause.h.

Referenced by clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getMapTypeModifiers()

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

Fetches ArrayRef of map-type-modifiers.

Definition at line 4244 of file OpenMPClause.h.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective().

## ◆ getMapTypeModifiersLoc()

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

Fetches ArrayRef of location of map-type-modifiers.

Definition at line 4249 of file OpenMPClause.h.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective().

## ◆ isImplicitMapType()

bool 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 4222 of file OpenMPClause.h.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective().

## Friends And Related Function Documentation

## ◆ OMPClauseReader

friend class OMPClauseReader
| friend

Definition at line 4047 of file OpenMPClause.h.

## Member Data Documentation

## ◆ NumberOfModifiers

constexpr unsigned OMPMapClause::NumberOfModifiers
| static

Initial value:
=
OMPC_MAP_MODIFIER_last - OMPC_MAP_MODIFIER_unknown - 1

Number of allowed map-type-modifiers.

Definition at line 4066 of file OpenMPClause.h.

Referenced by clang::Sema::ActOnOpenMPMapClause(), OMPIsDevicePtrClause::CreateEmpty(), clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate(), and clang::OMPClauseReader::VisitOMPClauseWithPostUpdate().

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

- include/clang/AST/OpenMPClause.h
- lib/AST/OpenMPClause.cpp