|
clang 23.0.0git
|
Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses. More...
#include "clang/AST/OpenMPClause.h"
Classes | |
| class | MappableComponent |
| Class that represents a component of a mappable expression. E.g. for an expression S.a, the first component is a declaration reference expression associated with 'S' and the second is a member expression associated with the field declaration 'a'. If the expression is an array subscript it may not have any associated declaration. In that case the associated declaration is set to nullptr. More... | |
Public Types | |
| using | MappableExprComponentList = SmallVector<MappableComponent, 8> |
| using | MappableExprComponentListRef = ArrayRef<MappableComponent> |
| using | MappableExprComponentLists = SmallVector<MappableExprComponentList, 8> |
| using | MappableExprComponentListsRef = ArrayRef<MappableExprComponentList> |
Static Public Member Functions | |
| static QualType | getComponentExprElementType (const Expr *Exp) |
Get the type of an element of a ComponentList Expr Exp. | |
| static std::pair< const Expr *, std::optional< size_t > > | findAttachPtrExpr (MappableExprComponentListRef Components, OpenMPDirectiveKind CurDirKind) |
| Find the attach pointer expression from a list of mappable expression components. | |
Static Protected Member Functions | |
| static unsigned | getComponentsTotalNumber (MappableExprComponentListsRef ComponentLists) |
| static unsigned | getUniqueDeclarationsTotalNumber (ArrayRef< const ValueDecl * > Declarations) |
Friends | |
| llvm::hash_code | hash_value (const MappableComponent &MC) |
Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses.
Definition at line 5875 of file OpenMPClause.h.
Definition at line 5926 of file OpenMPClause.h.
Definition at line 5927 of file OpenMPClause.h.
| using OMPClauseMappableExprCommon::MappableExprComponentLists = SmallVector<MappableExprComponentList, 8> |
Definition at line 5932 of file OpenMPClause.h.
| using OMPClauseMappableExprCommon::MappableExprComponentListsRef = ArrayRef<MappableExprComponentList> |
Definition at line 5933 of file OpenMPClause.h.
|
static |
Find the attach pointer expression from a list of mappable expression components.
This function traverses the component list to find the first expression that has a pointer type, which represents the attach base pointer expr for the current component-list.
For example, given the following:
The base-pointers for the following map operands would be: map list-item | attach base-pointer | attach base-pointer | for directives except | target_update (if | target_update | different) -------------—|--------------------—|------------------— s | N/A | s.a | N/A | s.p | N/A | ps | N/A | ps->p | ps | ps[1] | ps | *(ps + 1) | ps | (ps + 1)[1] | ps | ps[1:10] | ps | ps->b[10] | ps | ps->p[10] | ps->p | ps->c[1][2] | ps | ps->c[1:2][2] | (error diagnostic) | N/A, TODO: ps ps->c[1:1][2] | ps | N/A, TODO: ps pps[1][2] | pps[1] | pps[1:1][2] | pps[1:1] | N/A, TODO: pps[1:1] pps[1:i][2] | pps[1:i] | N/A, TODO: pps[1:i] pps[1:2][2] | (error diagnostic) | N/A pps[1]->p | pps[1] | pps[1]->p[10] | pps[1] | pas[1] | N/A | pas[1][2] | pas[1] | ppps[1][2] | ppps[1] | ppps[1][2][3] | ppps[1][2] | ppps[1][2:1][3] | ppps[1][2:1] | N/A, TODO: ppps[1][2:1] ppps[1][2:2][3] | (error diagnostic) | N/A Returns a pair of the attach pointer expression and its depth in the component list. TODO: This may need to be updated to handle ref_ptr/ptee cases for byref map operands. TODO: Handle cases for target-update, where the list-item is a non-contiguous array-section that still has a base-pointer.
Definition at line 1220 of file OpenMPClause.cpp.
References getComponentExprElementType(), clang::isa(), and clang::Type::isPointerType().
Referenced by clang::SemaOpenMP::ActOnOpenMPUseDeviceAddrClause().
Get the type of an element of a ComponentList Expr Exp.
For something like the following:
The types for the following Exprs would be:
| Expr | Type |
|---|---|
| p | int * |
| *p | int |
| p[0] | int |
| p[0:1] | int |
| pp | int ** |
| pp[0] | int * |
| pp[0:1] | int * |
Note: this assumes that if Exp is an array-section, it is contiguous.
Definition at line 1194 of file OpenMPClause.cpp.
References clang::cast(), clang::ArraySectionExpr::getBaseOriginalType(), clang::QualType::getCanonicalType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::Expr::getType(), and clang::isa().
Referenced by findAttachPtrExpr().
|
staticprotected |
Definition at line 1175 of file OpenMPClause.cpp.
References clang::C.
Referenced by OMPFromClause::Create(), OMPHasDeviceAddrClause::Create(), OMPIsDevicePtrClause::Create(), OMPMapClause::Create(), OMPToClause::Create(), OMPUseDeviceAddrClause::Create(), OMPUseDevicePtrClause::Create(), and OMPMappableExprListClause< T >::setClauseInfo().
|
staticprotected |
Definition at line 1183 of file OpenMPClause.cpp.
References clang::cast().
Referenced by OMPFromClause::Create(), OMPHasDeviceAddrClause::Create(), OMPIsDevicePtrClause::Create(), OMPMapClause::Create(), OMPToClause::Create(), OMPUseDeviceAddrClause::Create(), OMPUseDevicePtrClause::Create(), and OMPMappableExprListClause< T >::setClauseInfo().
|
friend |