@@ -1301,46 +1301,25 @@ struct OpenACCReductionRecipe {
13011301 // AST), or in a separate collection when being semantically analyzed.
13021302 llvm::ArrayRef<CombinerRecipe> CombinerRecipes;
13031303
1304+ bool isSet () const { return AllocaDecl; }
1305+
1306+ private:
1307+ friend class OpenACCReductionClause ;
13041308 OpenACCReductionRecipe (VarDecl *A, llvm::ArrayRef<CombinerRecipe> Combiners)
13051309 : AllocaDecl(A), CombinerRecipes(Combiners) {}
1306-
1307- bool isSet () const { return AllocaDecl; }
13081310};
13091311
13101312// A version of the above that is used for semantic analysis, at a time before
13111313// the OpenACCReductionClause node has been created. This one has storage for
13121314// the CombinerRecipe, since Trailing storage for it doesn't exist yet.
1313- struct OpenACCReductionRecipeWithStorage : OpenACCReductionRecipe {
1314- private:
1315- llvm::SmallVector<CombinerRecipe, 1 > CombinerRecipeStorage;
1316-
1317- public:
1318- OpenACCReductionRecipeWithStorage (VarDecl *A,
1319- llvm::ArrayRef<CombinerRecipe> Combiners)
1320- : OpenACCReductionRecipe(A, {}), CombinerRecipeStorage(Combiners) {
1321- CombinerRecipes = CombinerRecipeStorage;
1322- }
1315+ struct OpenACCReductionRecipeWithStorage {
1316+ VarDecl *AllocaDecl;
1317+ llvm::SmallVector<OpenACCReductionRecipe::CombinerRecipe, 1 > CombinerRecipes;
13231318
13241319 OpenACCReductionRecipeWithStorage (
1325- const OpenACCReductionRecipeWithStorage &Other)
1326- : OpenACCReductionRecipe(Other),
1327- CombinerRecipeStorage (Other.CombinerRecipeStorage) {
1328- CombinerRecipes = CombinerRecipeStorage;
1329- }
1330-
1331- OpenACCReductionRecipeWithStorage (OpenACCReductionRecipeWithStorage &&Other)
1332- : OpenACCReductionRecipe(std::move(Other)),
1333- CombinerRecipeStorage(std::move(Other.CombinerRecipeStorage)) {
1334- CombinerRecipes = CombinerRecipeStorage;
1335- }
1336-
1337- // There is no real problem implementing these, we just have to make sure the
1338- // array-ref this inherits from stays in sync. But as we don't need it at the
1339- // moment, make sure we don't accidentially call these.
1340- OpenACCReductionRecipeWithStorage &
1341- operator =(OpenACCReductionRecipeWithStorage &&) = delete ;
1342- OpenACCReductionRecipeWithStorage &
1343- operator =(const OpenACCReductionRecipeWithStorage &) = delete ;
1320+ VarDecl *A,
1321+ llvm::ArrayRef<OpenACCReductionRecipe::CombinerRecipe> Combiners)
1322+ : AllocaDecl(A), CombinerRecipes(Combiners) {}
13441323
13451324 static OpenACCReductionRecipeWithStorage Empty () {
13461325 return OpenACCReductionRecipeWithStorage (/* AllocaDecl=*/ nullptr , {});
0 commit comments