diff options
Diffstat (limited to 'lib/AST/OpenMPClause.cpp')
-rw-r--r-- | lib/AST/OpenMPClause.cpp | 327 |
1 files changed, 198 insertions, 129 deletions
diff --git a/lib/AST/OpenMPClause.cpp b/lib/AST/OpenMPClause.cpp index 76098f15bf..5bd4ad81bf 100644 --- a/lib/AST/OpenMPClause.cpp +++ b/lib/AST/OpenMPClause.cpp @@ -1,9 +1,8 @@ //===- OpenMPClause.cpp - Classes for OpenMP clauses ----------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -74,6 +73,8 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) { case OMPC_final: case OMPC_safelen: case OMPC_simdlen: + case OMPC_allocator: + case OMPC_allocate: case OMPC_collapse: case OMPC_private: case OMPC_shared: @@ -145,6 +146,8 @@ const OMPClauseWithPostUpdate *OMPClauseWithPostUpdate::get(const OMPClause *C) case OMPC_num_threads: case OMPC_safelen: case OMPC_simdlen: + case OMPC_allocator: + case OMPC_allocate: case OMPC_collapse: case OMPC_private: case OMPC_shared: @@ -698,6 +701,25 @@ OMPInReductionClause *OMPInReductionClause::CreateEmpty(const ASTContext &C, return new (Mem) OMPInReductionClause(N); } +OMPAllocateClause * +OMPAllocateClause::Create(const ASTContext &C, SourceLocation StartLoc, + SourceLocation LParenLoc, Expr *Allocator, + SourceLocation ColonLoc, SourceLocation EndLoc, + ArrayRef<Expr *> VL) { + // Allocate space for private variables and initializer expressions. + void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size())); + auto *Clause = new (Mem) OMPAllocateClause(StartLoc, LParenLoc, Allocator, + ColonLoc, EndLoc, VL.size()); + Clause->setVarRefs(VL); + return Clause; +} + +OMPAllocateClause *OMPAllocateClause::CreateEmpty(const ASTContext &C, + unsigned N) { + void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N)); + return new (Mem) OMPAllocateClause(N); +} + OMPFlushClause *OMPFlushClause::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, @@ -791,24 +813,23 @@ unsigned OMPClauseMappableExprCommon::getUniqueDeclarationsTotalNumber( return TotalNum; } -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) { - unsigned NumVars = Vars.size(); - unsigned NumUniqueDeclarations = - getUniqueDeclarationsTotalNumber(Declarations); - unsigned NumComponentLists = ComponentLists.size(); - unsigned NumComponents = getComponentsTotalNumber(ComponentLists); +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) { + OMPMappableExprListSizeTy Sizes; + Sizes.NumVars = Vars.size(); + Sizes.NumUniqueDeclarations = getUniqueDeclarationsTotalNumber(Declarations); + Sizes.NumComponentLists = ComponentLists.size(); + Sizes.NumComponents = getComponentsTotalNumber(ComponentLists); // We need to allocate: - // NumVars x Expr* - we have an original list expression for each clause list - // entry. + // 2 x NumVars x Expr* - we have an original list expression and an associated + // user-defined mapper for each clause list entry. // NumUniqueDeclarations x ValueDecl* - unique base declarations associated // with each component list. // (NumUniqueDeclarations + NumComponentLists) x unsigned - we specify the @@ -819,47 +840,47 @@ OMPMapClause::Create(const ASTContext &C, SourceLocation StartLoc, void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); - OMPMapClause *Clause = new (Mem) OMPMapClause( - MapModifiers, MapModifiersLoc, Type, TypeIsImplicit, TypeLoc, StartLoc, - LParenLoc, EndLoc, NumVars, NumUniqueDeclarations, NumComponentLists, - NumComponents); + 2 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); + OMPMapClause *Clause = new (Mem) + OMPMapClause(MapModifiers, MapModifiersLoc, UDMQualifierLoc, MapperId, + Type, TypeIsImplicit, TypeLoc, Locs, Sizes); Clause->setVarRefs(Vars); + Clause->setUDMapperRefs(UDMapperRefs); Clause->setClauseInfo(Declarations, ComponentLists); Clause->setMapType(Type); Clause->setMapLoc(TypeLoc); return Clause; } -OMPMapClause *OMPMapClause::CreateEmpty(const ASTContext &C, unsigned NumVars, - unsigned NumUniqueDeclarations, - unsigned NumComponentLists, - unsigned NumComponents) { +OMPMapClause * +OMPMapClause::CreateEmpty(const ASTContext &C, + const OMPMappableExprListSizeTy &Sizes) { void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); - return new (Mem) OMPMapClause(NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); -} - -OMPToClause *OMPToClause::Create(const ASTContext &C, SourceLocation StartLoc, - SourceLocation LParenLoc, - SourceLocation EndLoc, ArrayRef<Expr *> Vars, - ArrayRef<ValueDecl *> Declarations, - MappableExprComponentListsRef ComponentLists) { - unsigned NumVars = Vars.size(); - unsigned NumUniqueDeclarations = - getUniqueDeclarationsTotalNumber(Declarations); - unsigned NumComponentLists = ComponentLists.size(); - unsigned NumComponents = getComponentsTotalNumber(ComponentLists); + 2 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); + return new (Mem) OMPMapClause(Sizes); +} + +OMPToClause *OMPToClause::Create( + const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef<Expr *> Vars, + ArrayRef<ValueDecl *> Declarations, + MappableExprComponentListsRef ComponentLists, ArrayRef<Expr *> UDMapperRefs, + NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId) { + OMPMappableExprListSizeTy Sizes; + Sizes.NumVars = Vars.size(); + Sizes.NumUniqueDeclarations = getUniqueDeclarationsTotalNumber(Declarations); + Sizes.NumComponentLists = ComponentLists.size(); + Sizes.NumComponents = getComponentsTotalNumber(ComponentLists); // We need to allocate: - // NumVars x Expr* - we have an original list expression for each clause list - // entry. + // 2 x NumVars x Expr* - we have an original list expression and an associated + // user-defined mapper for each clause list entry. // NumUniqueDeclarations x ValueDecl* - unique base declarations associated // with each component list. // (NumUniqueDeclarations + NumComponentLists) x unsigned - we specify the @@ -870,45 +891,43 @@ OMPToClause *OMPToClause::Create(const ASTContext &C, SourceLocation StartLoc, void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); + 2 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); - OMPToClause *Clause = new (Mem) - OMPToClause(StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + auto *Clause = new (Mem) OMPToClause(UDMQualifierLoc, MapperId, Locs, Sizes); Clause->setVarRefs(Vars); + Clause->setUDMapperRefs(UDMapperRefs); Clause->setClauseInfo(Declarations, ComponentLists); return Clause; } -OMPToClause *OMPToClause::CreateEmpty(const ASTContext &C, unsigned NumVars, - unsigned NumUniqueDeclarations, - unsigned NumComponentLists, - unsigned NumComponents) { +OMPToClause *OMPToClause::CreateEmpty(const ASTContext &C, + const OMPMappableExprListSizeTy &Sizes) { void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); - return new (Mem) OMPToClause(NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); -} - -OMPFromClause * -OMPFromClause::Create(const ASTContext &C, SourceLocation StartLoc, - SourceLocation LParenLoc, SourceLocation EndLoc, - ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations, - MappableExprComponentListsRef ComponentLists) { - unsigned NumVars = Vars.size(); - unsigned NumUniqueDeclarations = - getUniqueDeclarationsTotalNumber(Declarations); - unsigned NumComponentLists = ComponentLists.size(); - unsigned NumComponents = getComponentsTotalNumber(ComponentLists); + 2 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); + return new (Mem) OMPToClause(Sizes); +} + +OMPFromClause *OMPFromClause::Create( + const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef<Expr *> Vars, + ArrayRef<ValueDecl *> Declarations, + MappableExprComponentListsRef ComponentLists, ArrayRef<Expr *> UDMapperRefs, + NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId) { + OMPMappableExprListSizeTy Sizes; + Sizes.NumVars = Vars.size(); + Sizes.NumUniqueDeclarations = getUniqueDeclarationsTotalNumber(Declarations); + Sizes.NumComponentLists = ComponentLists.size(); + Sizes.NumComponents = getComponentsTotalNumber(ComponentLists); // We need to allocate: - // NumVars x Expr* - we have an original list expression for each clause list - // entry. + // 2 x NumVars x Expr* - we have an original list expression and an associated + // user-defined mapper for each clause list entry. // NumUniqueDeclarations x ValueDecl* - unique base declarations associated // with each component list. // (NumUniqueDeclarations + NumComponentLists) x unsigned - we specify the @@ -919,29 +938,29 @@ OMPFromClause::Create(const ASTContext &C, SourceLocation StartLoc, void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); + 2 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); - OMPFromClause *Clause = new (Mem) - OMPFromClause(StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + auto *Clause = + new (Mem) OMPFromClause(UDMQualifierLoc, MapperId, Locs, Sizes); Clause->setVarRefs(Vars); + Clause->setUDMapperRefs(UDMapperRefs); Clause->setClauseInfo(Declarations, ComponentLists); return Clause; } -OMPFromClause *OMPFromClause::CreateEmpty(const ASTContext &C, unsigned NumVars, - unsigned NumUniqueDeclarations, - unsigned NumComponentLists, - unsigned NumComponents) { +OMPFromClause * +OMPFromClause::CreateEmpty(const ASTContext &C, + const OMPMappableExprListSizeTy &Sizes) { void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); - return new (Mem) OMPFromClause(NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + 2 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); + return new (Mem) OMPFromClause(Sizes); } void OMPUseDevicePtrClause::setPrivateCopies(ArrayRef<Expr *> VL) { @@ -957,15 +976,15 @@ void OMPUseDevicePtrClause::setInits(ArrayRef<Expr *> VL) { } OMPUseDevicePtrClause *OMPUseDevicePtrClause::Create( - const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, ArrayRef<Expr *> Vars, ArrayRef<Expr *> PrivateVars, - ArrayRef<Expr *> Inits, ArrayRef<ValueDecl *> Declarations, + const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef<Expr *> Vars, + ArrayRef<Expr *> PrivateVars, ArrayRef<Expr *> Inits, + ArrayRef<ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists) { - unsigned NumVars = Vars.size(); - unsigned NumUniqueDeclarations = - getUniqueDeclarationsTotalNumber(Declarations); - unsigned NumComponentLists = ComponentLists.size(); - unsigned NumComponents = getComponentsTotalNumber(ComponentLists); + OMPMappableExprListSizeTy Sizes; + Sizes.NumVars = Vars.size(); + Sizes.NumUniqueDeclarations = getUniqueDeclarationsTotalNumber(Declarations); + Sizes.NumComponentLists = ComponentLists.size(); + Sizes.NumComponents = getComponentsTotalNumber(ComponentLists); // We need to allocate: // 3 x NumVars x Expr* - we have an original list expression for each clause @@ -980,12 +999,11 @@ OMPUseDevicePtrClause *OMPUseDevicePtrClause::Create( void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - 3 * NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); + 3 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); - OMPUseDevicePtrClause *Clause = new (Mem) OMPUseDevicePtrClause( - StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + OMPUseDevicePtrClause *Clause = new (Mem) OMPUseDevicePtrClause(Locs, Sizes); Clause->setVarRefs(Vars); Clause->setPrivateCopies(PrivateVars); @@ -994,29 +1012,28 @@ OMPUseDevicePtrClause *OMPUseDevicePtrClause::Create( return Clause; } -OMPUseDevicePtrClause *OMPUseDevicePtrClause::CreateEmpty( - const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, - unsigned NumComponentLists, unsigned NumComponents) { +OMPUseDevicePtrClause * +OMPUseDevicePtrClause::CreateEmpty(const ASTContext &C, + const OMPMappableExprListSizeTy &Sizes) { void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - 3 * NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); - return new (Mem) OMPUseDevicePtrClause(NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + 3 * Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); + return new (Mem) OMPUseDevicePtrClause(Sizes); } OMPIsDevicePtrClause * -OMPIsDevicePtrClause::Create(const ASTContext &C, SourceLocation StartLoc, - SourceLocation LParenLoc, SourceLocation EndLoc, +OMPIsDevicePtrClause::Create(const ASTContext &C, const OMPVarListLocTy &Locs, ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations, MappableExprComponentListsRef ComponentLists) { - unsigned NumVars = Vars.size(); - unsigned NumUniqueDeclarations = - getUniqueDeclarationsTotalNumber(Declarations); - unsigned NumComponentLists = ComponentLists.size(); - unsigned NumComponents = getComponentsTotalNumber(ComponentLists); + OMPMappableExprListSizeTy Sizes; + Sizes.NumVars = Vars.size(); + Sizes.NumUniqueDeclarations = getUniqueDeclarationsTotalNumber(Declarations); + Sizes.NumComponentLists = ComponentLists.size(); + Sizes.NumComponents = getComponentsTotalNumber(ComponentLists); // We need to allocate: // NumVars x Expr* - we have an original list expression for each clause list @@ -1031,28 +1048,27 @@ OMPIsDevicePtrClause::Create(const ASTContext &C, SourceLocation StartLoc, void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); + Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); - OMPIsDevicePtrClause *Clause = new (Mem) OMPIsDevicePtrClause( - StartLoc, LParenLoc, EndLoc, NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + OMPIsDevicePtrClause *Clause = new (Mem) OMPIsDevicePtrClause(Locs, Sizes); Clause->setVarRefs(Vars); Clause->setClauseInfo(Declarations, ComponentLists); return Clause; } -OMPIsDevicePtrClause *OMPIsDevicePtrClause::CreateEmpty( - const ASTContext &C, unsigned NumVars, unsigned NumUniqueDeclarations, - unsigned NumComponentLists, unsigned NumComponents) { +OMPIsDevicePtrClause * +OMPIsDevicePtrClause::CreateEmpty(const ASTContext &C, + const OMPMappableExprListSizeTy &Sizes) { void *Mem = C.Allocate( totalSizeToAlloc<Expr *, ValueDecl *, unsigned, OMPClauseMappableExprCommon::MappableComponent>( - NumVars, NumUniqueDeclarations, - NumUniqueDeclarations + NumComponentLists, NumComponents)); - return new (Mem) OMPIsDevicePtrClause(NumVars, NumUniqueDeclarations, - NumComponentLists, NumComponents); + Sizes.NumVars, Sizes.NumUniqueDeclarations, + Sizes.NumUniqueDeclarations + Sizes.NumComponentLists, + Sizes.NumComponents)); + return new (Mem) OMPIsDevicePtrClause(Sizes); } //===----------------------------------------------------------------------===// @@ -1091,6 +1107,12 @@ void OMPClausePrinter::VisitOMPSimdlenClause(OMPSimdlenClause *Node) { OS << ")"; } +void OMPClausePrinter::VisitOMPAllocatorClause(OMPAllocatorClause *Node) { + OS << "allocator("; + Node->getAllocator()->printPretty(OS, nullptr, Policy, 0); + OS << ")"; +} + void OMPClausePrinter::VisitOMPCollapseClause(OMPCollapseClause *Node) { OS << "collapse("; Node->getNumForLoops()->printPretty(OS, nullptr, Policy, 0); @@ -1261,6 +1283,21 @@ void OMPClausePrinter::VisitOMPClauseList(T *Node, char StartSym) { } } +void OMPClausePrinter::VisitOMPAllocateClause(OMPAllocateClause *Node) { + if (Node->varlist_empty()) + return; + OS << "allocate"; + if (Expr *Allocator = Node->getAllocator()) { + OS << "("; + Allocator->printPretty(OS, nullptr, Policy, 0); + OS << ":"; + VisitOMPClauseList(Node, ' '); + } else { + VisitOMPClauseList(Node, '('); + } + OS << ")"; +} + void OMPClausePrinter::VisitOMPPrivateClause(OMPPrivateClause *Node) { if (!Node->varlist_empty()) { OS << "private"; @@ -1432,6 +1469,14 @@ void OMPClausePrinter::VisitOMPMapClause(OMPMapClause *Node) { if (Node->getMapTypeModifier(I) != OMPC_MAP_MODIFIER_unknown) { OS << getOpenMPSimpleClauseTypeName(OMPC_map, Node->getMapTypeModifier(I)); + if (Node->getMapTypeModifier(I) == OMPC_MAP_MODIFIER_mapper) { + OS << '('; + NestedNameSpecifier *MapperNNS = + Node->getMapperQualifierLoc().getNestedNameSpecifier(); + if (MapperNNS) + MapperNNS->print(OS, Policy); + OS << Node->getMapperIdInfo() << ')'; + } OS << ','; } } @@ -1446,7 +1491,19 @@ void OMPClausePrinter::VisitOMPMapClause(OMPMapClause *Node) { void OMPClausePrinter::VisitOMPToClause(OMPToClause *Node) { if (!Node->varlist_empty()) { OS << "to"; - VisitOMPClauseList(Node, '('); + DeclarationNameInfo MapperId = Node->getMapperIdInfo(); + if (MapperId.getName() && !MapperId.getName().isEmpty()) { + OS << '('; + OS << "mapper("; + NestedNameSpecifier *MapperNNS = + Node->getMapperQualifierLoc().getNestedNameSpecifier(); + if (MapperNNS) + MapperNNS->print(OS, Policy); + OS << MapperId << "):"; + VisitOMPClauseList(Node, ' '); + } else { + VisitOMPClauseList(Node, '('); + } OS << ")"; } } @@ -1454,7 +1511,19 @@ void OMPClausePrinter::VisitOMPToClause(OMPToClause *Node) { void OMPClausePrinter::VisitOMPFromClause(OMPFromClause *Node) { if (!Node->varlist_empty()) { OS << "from"; - VisitOMPClauseList(Node, '('); + DeclarationNameInfo MapperId = Node->getMapperIdInfo(); + if (MapperId.getName() && !MapperId.getName().isEmpty()) { + OS << '('; + OS << "mapper("; + NestedNameSpecifier *MapperNNS = + Node->getMapperQualifierLoc().getNestedNameSpecifier(); + if (MapperNNS) + MapperNNS->print(OS, Policy); + OS << MapperId << "):"; + VisitOMPClauseList(Node, ' '); + } else { + VisitOMPClauseList(Node, '('); + } OS << ")"; } } |