diff --git a/clang/include/clang/AST/OpenACCClause.h b/clang/include/clang/AST/OpenACCClause.h index 7a1b17cc4e44e3..51db58d484a25f 100644 --- a/clang/include/clang/AST/OpenACCClause.h +++ b/clang/include/clang/AST/OpenACCClause.h @@ -191,8 +191,9 @@ using DeviceTypeArgument = std::pair; /// an identifier. The 'asterisk' means 'the rest'. class OpenACCDeviceTypeClause final : public OpenACCClauseWithParams, - public llvm::TrailingObjects { + friend TrailingObjects; // Data stored in trailing objects as IdentifierInfo* /SourceLocation pairs. A // nullptr IdentifierInfo* represents an asterisk. unsigned NumArchs; @@ -377,7 +378,8 @@ class OpenACCClauseWithExprs : public OpenACCClauseWithParams { // Represents the 'devnum' and expressions lists for the 'wait' clause. class OpenACCWaitClause final : public OpenACCClauseWithExprs, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; SourceLocation QueuesLoc; OpenACCWaitClause(SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc, @@ -419,7 +421,8 @@ class OpenACCWaitClause final class OpenACCNumGangsClause final : public OpenACCClauseWithExprs, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCNumGangsClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef IntExprs, SourceLocation EndLoc) @@ -449,7 +452,8 @@ class OpenACCNumGangsClause final class OpenACCTileClause final : public OpenACCClauseWithExprs, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCTileClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef SizeExprs, SourceLocation EndLoc) : OpenACCClauseWithExprs(OpenACCClauseKind::Tile, BeginLoc, LParenLoc, @@ -503,7 +507,8 @@ class OpenACCClauseWithSingleIntExpr : public OpenACCClauseWithExprs { class OpenACCGangClause final : public OpenACCClauseWithExprs, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; protected: OpenACCGangClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef GangKinds, @@ -658,7 +663,8 @@ class OpenACCClauseWithVarList : public OpenACCClauseWithExprs { class OpenACCPrivateClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCPrivateClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -680,7 +686,8 @@ class OpenACCPrivateClause final class OpenACCFirstPrivateClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCFirstPrivateClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -702,7 +709,8 @@ class OpenACCFirstPrivateClause final class OpenACCDevicePtrClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCDevicePtrClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -724,7 +732,8 @@ class OpenACCDevicePtrClause final class OpenACCAttachClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCAttachClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -746,7 +755,8 @@ class OpenACCAttachClause final class OpenACCDetachClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCDetachClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -768,7 +778,8 @@ class OpenACCDetachClause final class OpenACCDeleteClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCDeleteClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -790,7 +801,8 @@ class OpenACCDeleteClause final class OpenACCUseDeviceClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCUseDeviceClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -812,7 +824,8 @@ class OpenACCUseDeviceClause final class OpenACCNoCreateClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCNoCreateClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -834,7 +847,8 @@ class OpenACCNoCreateClause final class OpenACCPresentClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCPresentClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, SourceLocation EndLoc) @@ -856,7 +870,8 @@ class OpenACCPresentClause final class OpenACCCopyClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCCopyClause(OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef VarList, @@ -885,7 +900,8 @@ class OpenACCCopyClause final class OpenACCCopyInClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; bool IsReadOnly; OpenACCCopyInClause(OpenACCClauseKind Spelling, SourceLocation BeginLoc, @@ -917,7 +933,8 @@ class OpenACCCopyInClause final class OpenACCCopyOutClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; bool IsZero; OpenACCCopyOutClause(OpenACCClauseKind Spelling, SourceLocation BeginLoc, @@ -949,7 +966,8 @@ class OpenACCCopyOutClause final class OpenACCCreateClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; bool IsZero; OpenACCCreateClause(OpenACCClauseKind Spelling, SourceLocation BeginLoc, @@ -981,7 +999,8 @@ class OpenACCCreateClause final class OpenACCReductionClause final : public OpenACCClauseWithVarList, - public llvm::TrailingObjects { + private llvm::TrailingObjects { + friend TrailingObjects; OpenACCReductionOperator Op; OpenACCReductionClause(SourceLocation BeginLoc, SourceLocation LParenLoc, diff --git a/clang/include/clang/AST/StmtOpenACC.h b/clang/include/clang/AST/StmtOpenACC.h index e256a4b7c69eb5..a1903cd9e3a23a 100644 --- a/clang/include/clang/AST/StmtOpenACC.h +++ b/clang/include/clang/AST/StmtOpenACC.h @@ -127,11 +127,12 @@ class OpenACCAssociatedStmtConstruct : public OpenACCConstructStmt { /// the 'Kind'. class OpenACCComputeConstruct final : public OpenACCAssociatedStmtConstruct, - public llvm::TrailingObjects { + private llvm::TrailingObjects { friend class ASTStmtWriter; friend class ASTStmtReader; friend class ASTContext; + friend TrailingObjects; OpenACCComputeConstruct(unsigned NumClauses) : OpenACCAssociatedStmtConstruct( OpenACCComputeConstructClass, OpenACCDirectiveKind::Invalid, @@ -189,7 +190,7 @@ class OpenACCComputeConstruct final /// Construct. class OpenACCLoopConstruct final : public OpenACCAssociatedStmtConstruct, - public llvm::TrailingObjects { // The compute/combined construct kind this loop is associated with, or // invalid if this is an orphaned loop construct. @@ -202,6 +203,7 @@ class OpenACCLoopConstruct final friend class OpenACCAssociatedStmtConstruct; friend class OpenACCCombinedConstruct; friend class OpenACCComputeConstruct; + friend TrailingObjects; OpenACCLoopConstruct(unsigned NumClauses); @@ -245,8 +247,9 @@ class OpenACCLoopConstruct final // shared with both loop and compute constructs. class OpenACCCombinedConstruct final : public OpenACCAssociatedStmtConstruct, - public llvm::TrailingObjects { + friend TrailingObjects; OpenACCCombinedConstruct(unsigned NumClauses) : OpenACCAssociatedStmtConstruct( OpenACCCombinedConstructClass, OpenACCDirectiveKind::Invalid, @@ -297,8 +300,9 @@ class OpenACCCombinedConstruct final // and clauses, but is otherwise pretty simple. class OpenACCDataConstruct final : public OpenACCAssociatedStmtConstruct, - public llvm::TrailingObjects { + friend TrailingObjects; OpenACCDataConstruct(unsigned NumClauses) : OpenACCAssociatedStmtConstruct( OpenACCDataConstructClass, OpenACCDirectiveKind::Data, @@ -345,8 +349,9 @@ class OpenACCDataConstruct final // This class represents a 'enter data' construct, which JUST has clauses. class OpenACCEnterDataConstruct final : public OpenACCConstructStmt, - public llvm::TrailingObjects { + friend TrailingObjects; OpenACCEnterDataConstruct(unsigned NumClauses) : OpenACCConstructStmt(OpenACCEnterDataConstructClass, OpenACCDirectiveKind::EnterData, SourceLocation{}, @@ -382,8 +387,9 @@ class OpenACCEnterDataConstruct final // This class represents a 'exit data' construct, which JUST has clauses. class OpenACCExitDataConstruct final : public OpenACCConstructStmt, - public llvm::TrailingObjects { + friend TrailingObjects; OpenACCExitDataConstruct(unsigned NumClauses) : OpenACCConstructStmt(OpenACCExitDataConstructClass, OpenACCDirectiveKind::ExitData, SourceLocation{}, @@ -420,8 +426,9 @@ class OpenACCExitDataConstruct final // statement and clauses, but is otherwise pretty simple. class OpenACCHostDataConstruct final : public OpenACCAssociatedStmtConstruct, - public llvm::TrailingObjects { + friend TrailingObjects; OpenACCHostDataConstruct(unsigned NumClauses) : OpenACCAssociatedStmtConstruct( OpenACCHostDataConstructClass, OpenACCDirectiveKind::HostData,