Skip to content

Commit 7da6c64

Browse files
Reset return type of base visitor classes to void
1 parent b953d80 commit 7da6c64

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,13 +2829,13 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
28292829
} // namespace
28302830

28312831
class SYCLKernelNameTypeVisitor
2832-
: public TypeVisitor<SYCLKernelNameTypeVisitor, bool>,
2833-
public ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor, bool> {
2832+
: public TypeVisitor<SYCLKernelNameTypeVisitor>,
2833+
public ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor> {
28342834
Sema &S;
28352835
SourceLocation KernelInvocationFuncLoc;
2836-
using InnerTypeVisitor = TypeVisitor<SYCLKernelNameTypeVisitor, bool>;
2836+
using InnerTypeVisitor = TypeVisitor<SYCLKernelNameTypeVisitor>;
28372837
using InnerTAVisitor =
2838-
ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor, bool>;
2838+
ConstTemplateArgumentVisitor<SYCLKernelNameTypeVisitor>;
28392839
bool IsInvalid = false;
28402840

28412841
public:
@@ -2844,12 +2844,12 @@ class SYCLKernelNameTypeVisitor
28442844

28452845
bool isValid() { return !IsInvalid; }
28462846

2847-
bool Visit(QualType T) {
2847+
void Visit(QualType T) {
28482848
if (T.isNull())
2849-
return false;
2849+
return;
28502850
const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
28512851
if (!RD)
2852-
return false;
2852+
return;
28532853
// If KernelNameType has template args visit each template arg via
28542854
// ConstTemplateArgumentVisitor
28552855
if (const auto *TSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
@@ -2860,33 +2860,30 @@ class SYCLKernelNameTypeVisitor
28602860
} else {
28612861
InnerTypeVisitor::Visit(T.getTypePtr());
28622862
}
2863-
return true;
28642863
}
28652864

2866-
bool Visit(const TemplateArgument &TA) {
2865+
void Visit(const TemplateArgument &TA) {
28672866
if (TA.isNull())
2868-
return false;
2869-
return InnerTAVisitor::Visit(TA);
2867+
return;
2868+
InnerTAVisitor::Visit(TA);
28702869
}
28712870

2872-
bool VisitEnumType(const EnumType *T) {
2871+
void VisitEnumType(const EnumType *T) {
28732872
const EnumDecl *ED = T->getDecl();
28742873
if (!ED->isScoped() && !ED->isFixed()) {
28752874
S.Diag(KernelInvocationFuncLoc, diag::err_sycl_kernel_incorrectly_named)
28762875
<< /* Unscoped enum requires fixed underlying type */ 2;
28772876
S.Diag(ED->getSourceRange().getBegin(), diag::note_entity_declared_at)
28782877
<< ED;
28792878
IsInvalid = true;
2880-
return isValid();
28812879
}
2882-
return true;
28832880
}
28842881

2885-
bool VisitRecordType(const RecordType *T) {
2882+
void VisitRecordType(const RecordType *T) {
28862883
return VisitTagDecl(T->getDecl());
28872884
}
28882885

2889-
bool VisitTagDecl(const TagDecl *Tag) {
2886+
void VisitTagDecl(const TagDecl *Tag) {
28902887
bool UnnamedLambdaEnabled =
28912888
S.getASTContext().getLangOpts().SYCLUnnamedLambda;
28922889
if (!Tag->getDeclContext()->isTranslationUnit() &&
@@ -2908,35 +2905,31 @@ class SYCLKernelNameTypeVisitor
29082905
S.Diag(Tag->getSourceRange().getBegin(), diag::note_previous_decl)
29092906
<< Tag->getName();
29102907
}
2911-
return isValid();
29122908
}
2913-
return true;
29142909
}
29152910

2916-
bool VisitTypeTemplateArgument(const TemplateArgument &TA) {
2911+
void VisitTypeTemplateArgument(const TemplateArgument &TA) {
29172912
QualType T = TA.getAsType();
29182913
if (const auto *ET = T->getAs<EnumType>())
2919-
return VisitEnumType(ET);
2920-
return Visit(T);
2914+
VisitEnumType(ET);
2915+
Visit(T);
29212916
}
29222917

2923-
bool VisitIntegralTemplateArgument(const TemplateArgument &TA) {
2918+
void VisitIntegralTemplateArgument(const TemplateArgument &TA) {
29242919
QualType T = TA.getIntegralType();
29252920
if (const EnumType *ET = T->getAs<EnumType>())
2926-
return VisitEnumType(ET);
2927-
return true;
2921+
VisitEnumType(ET);
29282922
}
29292923

2930-
bool VisitTemplateTemplateArgument(const TemplateArgument &TA) {
2924+
void VisitTemplateTemplateArgument(const TemplateArgument &TA) {
29312925
TemplateDecl *TD = TA.getAsTemplate().getAsTemplateDecl();
29322926
TemplateParameterList *TemplateParams = TD->getTemplateParameters();
29332927
for (NamedDecl *P : *TemplateParams) {
29342928
if (NonTypeTemplateParmDecl *TemplateParam =
29352929
dyn_cast<NonTypeTemplateParmDecl>(P))
29362930
if (const EnumType *ET = TemplateParam->getType()->getAs<EnumType>())
2937-
return VisitEnumType(ET);
2931+
VisitEnumType(ET);
29382932
}
2939-
return true;
29402933
}
29412934
};
29422935

0 commit comments

Comments
 (0)