@@ -5682,11 +5682,11 @@ makeClusterDimsArgExpr(Sema &S, Expr *E, const CUDAClusterDimsAttr &AL,
56825682
56835683 // Accept template arguments for now as they depend on something else.
56845684 // We'll get to check them when they eventually get instantiated.
5685- if (E->isValueDependent ())
5685+ if (E->isInstantiationDependent ())
56865686 return {E, 1 };
56875687
5688- std::optional<llvm::APSInt> I = llvm::APSInt ( 64 );
5689- if (!(I = E-> getIntegerConstantExpr (S. Context )) ) {
5688+ std::optional<llvm::APSInt> I = E-> getIntegerConstantExpr (S. Context );
5689+ if (!I ) {
56905690 S.Diag (E->getExprLoc (), diag::err_attribute_argument_n_type)
56915691 << &AL << Idx << AANT_ArgumentIntegerConstant << E->getSourceRange ();
56925692 return {nullptr , 0 };
@@ -5754,7 +5754,7 @@ CUDAClusterDimsAttr *Sema::createClusterDimsAttr(const AttributeCommonInfo &CI,
57545754 return nullptr ;
57555755 }
57565756
5757- return :: new (Context) CUDAClusterDimsAttr (Context, CI, X, Y, Z);
5757+ return CUDAClusterDimsAttr::Create (Context, X, Y, Z, CI );
57585758}
57595759
57605760void Sema::addClusterDimsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *X,
@@ -5764,16 +5764,16 @@ void Sema::addClusterDimsAttr(Decl *D, const AttributeCommonInfo &CI, Expr *X,
57645764}
57655765
57665766void Sema::addNoClusterAttr (Decl *D, const AttributeCommonInfo &CI) {
5767- if (CUDANoClusterAttr *Attr = ::new (Context) CUDANoClusterAttr (Context, CI))
5768- D->addAttr (Attr);
5767+ D->addAttr (CUDANoClusterAttr::Create (Context, CI));
57695768}
57705769
57715770static void handleClusterDimsAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
57725771 auto &TTI = S.Context .getTargetInfo ();
57735772 auto Arch = StringToOffloadArch (TTI.getTargetOpts ().CPU );
57745773 if ((TTI.getTriple ().isNVPTX () && Arch < clang::OffloadArch::SM_90) ||
57755774 (TTI.getTriple ().isAMDGPU () && Arch < clang::OffloadArch::GFX1250)) {
5776- S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported) << 0 ;
5775+ S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported)
5776+ << " __cluster_dims__" ;
57775777 return ;
57785778 }
57795779
@@ -5791,7 +5791,8 @@ static void handleNoClusterAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
57915791 auto Arch = StringToOffloadArch (TTI.getTargetOpts ().CPU );
57925792 if ((TTI.getTriple ().isNVPTX () && Arch < clang::OffloadArch::SM_90) ||
57935793 (TTI.getTriple ().isAMDGPU () && Arch < clang::OffloadArch::GFX1250)) {
5794- S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported) << 1 ;
5794+ S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported)
5795+ << " __no_cluster__" ;
57955796 return ;
57965797 }
57975798
0 commit comments