@@ -191,8 +191,9 @@ using DeviceTypeArgument = std::pair<IdentifierInfo *, SourceLocation>;
191191// / an identifier. The 'asterisk' means 'the rest'.
192192class OpenACCDeviceTypeClause final
193193 : public OpenACCClauseWithParams,
194- public llvm::TrailingObjects<OpenACCDeviceTypeClause,
194+ private llvm::TrailingObjects<OpenACCDeviceTypeClause,
195195 DeviceTypeArgument> {
196+ friend TrailingObjects;
196197 // Data stored in trailing objects as IdentifierInfo* /SourceLocation pairs. A
197198 // nullptr IdentifierInfo* represents an asterisk.
198199 unsigned NumArchs;
@@ -377,7 +378,8 @@ class OpenACCClauseWithExprs : public OpenACCClauseWithParams {
377378// Represents the 'devnum' and expressions lists for the 'wait' clause.
378379class OpenACCWaitClause final
379380 : public OpenACCClauseWithExprs,
380- public llvm::TrailingObjects<OpenACCWaitClause, Expr *> {
381+ private llvm::TrailingObjects<OpenACCWaitClause, Expr *> {
382+ friend TrailingObjects;
381383 SourceLocation QueuesLoc;
382384 OpenACCWaitClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
383385 Expr *DevNumExpr, SourceLocation QueuesLoc,
@@ -419,7 +421,8 @@ class OpenACCWaitClause final
419421
420422class OpenACCNumGangsClause final
421423 : public OpenACCClauseWithExprs,
422- public llvm::TrailingObjects<OpenACCNumGangsClause, Expr *> {
424+ private llvm::TrailingObjects<OpenACCNumGangsClause, Expr *> {
425+ friend TrailingObjects;
423426
424427 OpenACCNumGangsClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
425428 ArrayRef<Expr *> IntExprs, SourceLocation EndLoc)
@@ -449,7 +452,8 @@ class OpenACCNumGangsClause final
449452
450453class OpenACCTileClause final
451454 : public OpenACCClauseWithExprs,
452- public llvm::TrailingObjects<OpenACCTileClause, Expr *> {
455+ private llvm::TrailingObjects<OpenACCTileClause, Expr *> {
456+ friend TrailingObjects;
453457 OpenACCTileClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
454458 ArrayRef<Expr *> SizeExprs, SourceLocation EndLoc)
455459 : OpenACCClauseWithExprs(OpenACCClauseKind::Tile, BeginLoc, LParenLoc,
@@ -503,7 +507,8 @@ class OpenACCClauseWithSingleIntExpr : public OpenACCClauseWithExprs {
503507
504508class OpenACCGangClause final
505509 : public OpenACCClauseWithExprs,
506- public llvm::TrailingObjects<OpenACCGangClause, Expr *, OpenACCGangKind> {
510+ private llvm::TrailingObjects<OpenACCGangClause, Expr *, OpenACCGangKind> {
511+ friend TrailingObjects;
507512protected:
508513 OpenACCGangClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
509514 ArrayRef<OpenACCGangKind> GangKinds,
@@ -658,7 +663,8 @@ class OpenACCClauseWithVarList : public OpenACCClauseWithExprs {
658663
659664class OpenACCPrivateClause final
660665 : public OpenACCClauseWithVarList,
661- public llvm::TrailingObjects<OpenACCPrivateClause, Expr *> {
666+ private llvm::TrailingObjects<OpenACCPrivateClause, Expr *> {
667+ friend TrailingObjects;
662668
663669 OpenACCPrivateClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
664670 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -680,7 +686,8 @@ class OpenACCPrivateClause final
680686
681687class OpenACCFirstPrivateClause final
682688 : public OpenACCClauseWithVarList,
683- public llvm::TrailingObjects<OpenACCFirstPrivateClause, Expr *> {
689+ private llvm::TrailingObjects<OpenACCFirstPrivateClause, Expr *> {
690+ friend TrailingObjects;
684691
685692 OpenACCFirstPrivateClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
686693 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -702,7 +709,8 @@ class OpenACCFirstPrivateClause final
702709
703710class OpenACCDevicePtrClause final
704711 : public OpenACCClauseWithVarList,
705- public llvm::TrailingObjects<OpenACCDevicePtrClause, Expr *> {
712+ private llvm::TrailingObjects<OpenACCDevicePtrClause, Expr *> {
713+ friend TrailingObjects;
706714
707715 OpenACCDevicePtrClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
708716 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -724,7 +732,8 @@ class OpenACCDevicePtrClause final
724732
725733class OpenACCAttachClause final
726734 : public OpenACCClauseWithVarList,
727- public llvm::TrailingObjects<OpenACCAttachClause, Expr *> {
735+ private llvm::TrailingObjects<OpenACCAttachClause, Expr *> {
736+ friend TrailingObjects;
728737
729738 OpenACCAttachClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
730739 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -746,7 +755,8 @@ class OpenACCAttachClause final
746755
747756class OpenACCDetachClause final
748757 : public OpenACCClauseWithVarList,
749- public llvm::TrailingObjects<OpenACCDetachClause, Expr *> {
758+ private llvm::TrailingObjects<OpenACCDetachClause, Expr *> {
759+ friend TrailingObjects;
750760
751761 OpenACCDetachClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
752762 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -768,7 +778,8 @@ class OpenACCDetachClause final
768778
769779class OpenACCDeleteClause final
770780 : public OpenACCClauseWithVarList,
771- public llvm::TrailingObjects<OpenACCDeleteClause, Expr *> {
781+ private llvm::TrailingObjects<OpenACCDeleteClause, Expr *> {
782+ friend TrailingObjects;
772783
773784 OpenACCDeleteClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
774785 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -790,7 +801,8 @@ class OpenACCDeleteClause final
790801
791802class OpenACCUseDeviceClause final
792803 : public OpenACCClauseWithVarList,
793- public llvm::TrailingObjects<OpenACCUseDeviceClause, Expr *> {
804+ private llvm::TrailingObjects<OpenACCUseDeviceClause, Expr *> {
805+ friend TrailingObjects;
794806
795807 OpenACCUseDeviceClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
796808 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -812,7 +824,8 @@ class OpenACCUseDeviceClause final
812824
813825class OpenACCNoCreateClause final
814826 : public OpenACCClauseWithVarList,
815- public llvm::TrailingObjects<OpenACCNoCreateClause, Expr *> {
827+ private llvm::TrailingObjects<OpenACCNoCreateClause, Expr *> {
828+ friend TrailingObjects;
816829
817830 OpenACCNoCreateClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
818831 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -834,7 +847,8 @@ class OpenACCNoCreateClause final
834847
835848class OpenACCPresentClause final
836849 : public OpenACCClauseWithVarList,
837- public llvm::TrailingObjects<OpenACCPresentClause, Expr *> {
850+ private llvm::TrailingObjects<OpenACCPresentClause, Expr *> {
851+ friend TrailingObjects;
838852
839853 OpenACCPresentClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
840854 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
@@ -856,7 +870,8 @@ class OpenACCPresentClause final
856870
857871class OpenACCCopyClause final
858872 : public OpenACCClauseWithVarList,
859- public llvm::TrailingObjects<OpenACCCopyClause, Expr *> {
873+ private llvm::TrailingObjects<OpenACCCopyClause, Expr *> {
874+ friend TrailingObjects;
860875
861876 OpenACCCopyClause (OpenACCClauseKind Spelling, SourceLocation BeginLoc,
862877 SourceLocation LParenLoc, ArrayRef<Expr *> VarList,
@@ -885,7 +900,8 @@ class OpenACCCopyClause final
885900
886901class OpenACCCopyInClause final
887902 : public OpenACCClauseWithVarList,
888- public llvm::TrailingObjects<OpenACCCopyInClause, Expr *> {
903+ private llvm::TrailingObjects<OpenACCCopyInClause, Expr *> {
904+ friend TrailingObjects;
889905 bool IsReadOnly;
890906
891907 OpenACCCopyInClause (OpenACCClauseKind Spelling, SourceLocation BeginLoc,
@@ -917,7 +933,8 @@ class OpenACCCopyInClause final
917933
918934class OpenACCCopyOutClause final
919935 : public OpenACCClauseWithVarList,
920- public llvm::TrailingObjects<OpenACCCopyOutClause, Expr *> {
936+ private llvm::TrailingObjects<OpenACCCopyOutClause, Expr *> {
937+ friend TrailingObjects;
921938 bool IsZero;
922939
923940 OpenACCCopyOutClause (OpenACCClauseKind Spelling, SourceLocation BeginLoc,
@@ -949,7 +966,8 @@ class OpenACCCopyOutClause final
949966
950967class OpenACCCreateClause final
951968 : public OpenACCClauseWithVarList,
952- public llvm::TrailingObjects<OpenACCCreateClause, Expr *> {
969+ private llvm::TrailingObjects<OpenACCCreateClause, Expr *> {
970+ friend TrailingObjects;
953971 bool IsZero;
954972
955973 OpenACCCreateClause (OpenACCClauseKind Spelling, SourceLocation BeginLoc,
@@ -981,7 +999,8 @@ class OpenACCCreateClause final
981999
9821000class OpenACCReductionClause final
9831001 : public OpenACCClauseWithVarList,
984- public llvm::TrailingObjects<OpenACCReductionClause, Expr *> {
1002+ private llvm::TrailingObjects<OpenACCReductionClause, Expr *> {
1003+ friend TrailingObjects;
9851004 OpenACCReductionOperator Op;
9861005
9871006 OpenACCReductionClause (SourceLocation BeginLoc, SourceLocation LParenLoc,
0 commit comments