Refactor suggested in D103037 to help avoid similar copy-paste errors.
Change is mechanical. Some parts of this would be more robust with unsigned.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
|---|---|---|
| 804–805 | minor change here, previously a single error message was used for either case. | |
| openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
|---|---|---|
| 739 | How about making the change that clang-tidy is suggesting here? Another question: Any specific reason why you are not using std::min? Is it because emitting the DP becomes a bit cumbersome? | |
| openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
|---|---|---|
| 739 | Pretty much. min doesn't say whether it made a change or not, and we've tied debug printing to whether a change was made. I can't think of a reason why else after a return would be considered bad. Will try google on that term. | |
- twist code around clang-tidy
| openmp/libomptarget/plugins/amdgpu/src/rtl.cpp | ||
|---|---|---|
| 739 |
That seems uncompelling in this case, but it's trivial to shuffle the code to avoid the diagnostic. E.g. latest version. | |
How about making the change that clang-tidy is suggesting here?
Another question: Any specific reason why you are not using std::min? Is it because emitting the DP becomes a bit cumbersome?