Skip to content

Commit 49c8ba5

Browse files
Fix code review comments
1 parent 52bd9a3 commit 49c8ba5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,11 +2845,9 @@ class SYCLKernelNameTypeVisitor
28452845
bool isValid() { return !IsInvalid; }
28462846

28472847
bool Visit(QualType T) {
2848-
if (T.isNull())
2849-
return false;
2848+
assert(!T.isNull() && "KernelNameType cannot be null");
28502849
const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
2851-
if (!RD)
2852-
return false;
2850+
assert(RD && "KernelNameType is not a record");
28532851
// If KernelNameType has template args visit each template arg via
28542852
// ConstTemplateArgumentVisitor
28552853
if (const auto *TSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
@@ -2864,8 +2862,7 @@ class SYCLKernelNameTypeVisitor
28642862
}
28652863

28662864
bool Visit(const TemplateArgument &TA) {
2867-
if (TA.isNull())
2868-
return false;
2865+
assert(!TA.isNull() && "TemplateArgument cannot be null");
28692866
return InnerTAVisitor::Visit(TA);
28702867
}
28712868

@@ -2917,8 +2914,7 @@ class SYCLKernelNameTypeVisitor
29172914
QualType T = TA.getAsType();
29182915
if (const auto *ET = T->getAs<EnumType>())
29192916
return VisitEnumType(ET);
2920-
else
2921-
return Visit(T);
2917+
return Visit(T);
29222918
}
29232919

29242920
bool VisitIntegralTemplateArgument(const TemplateArgument &TA) {

0 commit comments

Comments
 (0)