-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL][NFC] Code cleanup revealed by self-build. #3153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove redundant false case in switch statement following: https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations
clang/lib/Sema/SemaSYCL.cpp
Outdated
@@ -3477,7 +3481,6 @@ static const char *paramKind2Str(KernelParamKind K) { | |||
CASE(std_layout); | |||
CASE(sampler); | |||
CASE(pointer); | |||
default: | |||
return "<ERROR>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the return "" statement be moved outside the switch block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Updated it. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I was wondering how to guard against forgetting to add a handling for a new enum value when it is added. Clang is consistent here and also issues an error in such case error: enumeration value 'green' not handled in switch [-Werror,-Wswitch]
.
post-link approved
Remove redundant false case in switch statement following: https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations
clang/lib/Sema/SemaSYCL.cpp
Outdated
} | ||
return "<ERROR>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the clang-format error about indentation here. But otherwise, looks good.
modified: clang/lib/Sema/SemaSYCL.cpp
That switch-case macro change in SemaSYCL.cpp has now disappeared. Did you split that out? |
I had a conflict resolution and I have done it on this page! May be I should fix that in my ws. |
modified: clang/lib/Sema/SemaSYCL.cpp
Can someone please review this? Thanks. |
LGTM but code owners @AlexeySachkov @kbobrovs needs to approve. |
Sorry @zahiraam, I missed getting back to this after the intermittent test failure issue. |
No worries. I have more reviews coming and wanted this one to be merged in before. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment: here and in future commits/PRs: please add '-s' option to 'git commit' command to add a signature the the commit message.
FYI: it's not required by https://github.com/intel/llvm/blob/sycl/CONTRIBUTING.md anymore. |
Remove redundant false case in switch statement following: https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations
Remove redundant false case in switch statement following:
https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations