@@ -2829,13 +2829,13 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
2829
2829
} // namespace
2830
2830
2831
2831
class SYCLKernelNameTypeVisitor
2832
- : public TypeVisitor<SYCLKernelNameTypeVisitor, bool >,
2833
- public ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor, bool > {
2832
+ : public TypeVisitor<SYCLKernelNameTypeVisitor>,
2833
+ public ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor> {
2834
2834
Sema &S;
2835
2835
SourceLocation KernelInvocationFuncLoc;
2836
- using InnerTypeVisitor = TypeVisitor<SYCLKernelNameTypeVisitor, bool >;
2836
+ using InnerTypeVisitor = TypeVisitor<SYCLKernelNameTypeVisitor>;
2837
2837
using InnerTAVisitor =
2838
- ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor, bool >;
2838
+ ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor>;
2839
2839
bool IsInvalid = false ;
2840
2840
2841
2841
public:
@@ -2844,12 +2844,12 @@ class SYCLKernelNameTypeVisitor
2844
2844
2845
2845
bool isValid () { return !IsInvalid; }
2846
2846
2847
- bool Visit (QualType T) {
2847
+ void Visit (QualType T) {
2848
2848
if (T.isNull ())
2849
- return false ;
2849
+ return ;
2850
2850
const CXXRecordDecl *RD = T->getAsCXXRecordDecl ();
2851
2851
if (!RD)
2852
- return false ;
2852
+ return ;
2853
2853
// If KernelNameType has template args visit each template arg via
2854
2854
// ConstTemplateArgumentVisitor
2855
2855
if (const auto *TSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
@@ -2860,33 +2860,30 @@ class SYCLKernelNameTypeVisitor
2860
2860
} else {
2861
2861
InnerTypeVisitor::Visit (T.getTypePtr ());
2862
2862
}
2863
- return true ;
2864
2863
}
2865
2864
2866
- bool Visit (const TemplateArgument &TA) {
2865
+ void Visit (const TemplateArgument &TA) {
2867
2866
if (TA.isNull ())
2868
- return false ;
2869
- return InnerTAVisitor::Visit (TA);
2867
+ return ;
2868
+ InnerTAVisitor::Visit (TA);
2870
2869
}
2871
2870
2872
- bool VisitEnumType (const EnumType *T) {
2871
+ void VisitEnumType (const EnumType *T) {
2873
2872
const EnumDecl *ED = T->getDecl ();
2874
2873
if (!ED->isScoped () && !ED->isFixed ()) {
2875
2874
S.Diag (KernelInvocationFuncLoc, diag::err_sycl_kernel_incorrectly_named)
2876
2875
<< /* Unscoped enum requires fixed underlying type */ 2 ;
2877
2876
S.Diag (ED->getSourceRange ().getBegin (), diag::note_entity_declared_at)
2878
2877
<< ED;
2879
2878
IsInvalid = true ;
2880
- return isValid ();
2881
2879
}
2882
- return true ;
2883
2880
}
2884
2881
2885
- bool VisitRecordType (const RecordType *T) {
2882
+ void VisitRecordType (const RecordType *T) {
2886
2883
return VisitTagDecl (T->getDecl ());
2887
2884
}
2888
2885
2889
- bool VisitTagDecl (const TagDecl *Tag) {
2886
+ void VisitTagDecl (const TagDecl *Tag) {
2890
2887
bool UnnamedLambdaEnabled =
2891
2888
S.getASTContext ().getLangOpts ().SYCLUnnamedLambda ;
2892
2889
if (!Tag->getDeclContext ()->isTranslationUnit () &&
@@ -2908,35 +2905,31 @@ class SYCLKernelNameTypeVisitor
2908
2905
S.Diag (Tag->getSourceRange ().getBegin (), diag::note_previous_decl)
2909
2906
<< Tag->getName ();
2910
2907
}
2911
- return isValid ();
2912
2908
}
2913
- return true ;
2914
2909
}
2915
2910
2916
- bool VisitTypeTemplateArgument (const TemplateArgument &TA) {
2911
+ void VisitTypeTemplateArgument (const TemplateArgument &TA) {
2917
2912
QualType T = TA.getAsType ();
2918
2913
if (const auto *ET = T->getAs <EnumType>())
2919
- return VisitEnumType (ET);
2920
- return Visit (T);
2914
+ VisitEnumType (ET);
2915
+ Visit (T);
2921
2916
}
2922
2917
2923
- bool VisitIntegralTemplateArgument (const TemplateArgument &TA) {
2918
+ void VisitIntegralTemplateArgument (const TemplateArgument &TA) {
2924
2919
QualType T = TA.getIntegralType ();
2925
2920
if (const EnumType *ET = T->getAs <EnumType>())
2926
- return VisitEnumType (ET);
2927
- return true ;
2921
+ VisitEnumType (ET);
2928
2922
}
2929
2923
2930
- bool VisitTemplateTemplateArgument (const TemplateArgument &TA) {
2924
+ void VisitTemplateTemplateArgument (const TemplateArgument &TA) {
2931
2925
TemplateDecl *TD = TA.getAsTemplate ().getAsTemplateDecl ();
2932
2926
TemplateParameterList *TemplateParams = TD->getTemplateParameters ();
2933
2927
for (NamedDecl *P : *TemplateParams) {
2934
2928
if (NonTypeTemplateParmDecl *TemplateParam =
2935
2929
dyn_cast<NonTypeTemplateParmDecl>(P))
2936
2930
if (const EnumType *ET = TemplateParam->getType ()->getAs <EnumType>())
2937
- return VisitEnumType (ET);
2931
+ VisitEnumType (ET);
2938
2932
}
2939
- return true ;
2940
2933
}
2941
2934
};
2942
2935
0 commit comments