@@ -5686,11 +5686,11 @@ makeClusterDimsArgExpr(Sema &S, Expr *E, const CUDAClusterDimsAttr &AL,
56865686
56875687 // Accept template arguments for now as they depend on something else.
56885688 // We'll get to check them when they eventually get instantiated.
5689- if (E->isValueDependent ())
5689+ if (E->isInstantiationDependent ())
56905690 return {E, 1 };
56915691
5692- std::optional<llvm::APSInt> I = llvm::APSInt ( 64 );
5693- if (!(I = E-> getIntegerConstantExpr (S. Context )) ) {
5692+ std::optional<llvm::APSInt> I = E-> getIntegerConstantExpr (S. Context );
5693+ if (!I ) {
56945694 S.Diag (E->getExprLoc (), diag::err_attribute_argument_n_type)
56955695 << &AL << Idx << AANT_ArgumentIntegerConstant << E->getSourceRange ();
56965696 return {nullptr , 0 };
@@ -5758,7 +5758,7 @@ CUDAClusterDimsAttr *Sema::createClusterDimsAttr(const AttributeCommonInfo &CI,
57585758 return nullptr ;
57595759 }
57605760
5761- return :: new (Context) CUDAClusterDimsAttr (Context, CI, X, Y, Z);
5761+ return CUDAClusterDimsAttr::Create (Context, X, Y, Z, CI );
57625762}
57635763
57645764void Sema::addClusterDimsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *X,
@@ -5768,16 +5768,16 @@ void Sema::addClusterDimsAttr(Decl *D, const AttributeCommonInfo &CI, Expr *X,
57685768}
57695769
57705770void Sema::addNoClusterAttr (Decl *D, const AttributeCommonInfo &CI) {
5771- if (CUDANoClusterAttr *Attr = ::new (Context) CUDANoClusterAttr (Context, CI))
5772- D->addAttr (Attr);
5771+ D->addAttr (CUDANoClusterAttr::Create (Context, CI));
57735772}
57745773
57755774static void handleClusterDimsAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
57765775 auto &TTI = S.Context .getTargetInfo ();
57775776 auto Arch = StringToOffloadArch (TTI.getTargetOpts ().CPU );
57785777 if ((TTI.getTriple ().isNVPTX () && Arch < clang::OffloadArch::SM_90) ||
57795778 (TTI.getTriple ().isAMDGPU () && Arch < clang::OffloadArch::GFX1250)) {
5780- S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported) << 0 ;
5779+ S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported)
5780+ << " __cluster_dims__" ;
57815781 return ;
57825782 }
57835783
@@ -5795,7 +5795,8 @@ static void handleNoClusterAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
57955795 auto Arch = StringToOffloadArch (TTI.getTargetOpts ().CPU );
57965796 if ((TTI.getTriple ().isNVPTX () && Arch < clang::OffloadArch::SM_90) ||
57975797 (TTI.getTriple ().isAMDGPU () && Arch < clang::OffloadArch::GFX1250)) {
5798- S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported) << 1 ;
5798+ S.Diag (AL.getLoc (), diag::err_cuda_cluster_attr_not_supported)
5799+ << " __no_cluster__" ;
57995800 return ;
58005801 }
58015802
0 commit comments