Conversation
- Calling a grandparent's virtual method instead of the parent - Constructing a string from 0 is UB (in the unevaluated contexts in the LHS of the Generator overrides) - sizeof a pointer is considered a code smell
steven-johnson
approved these changes
Mar 11, 2020
xndcn
added a commit
to xndcn/Halide
that referenced
this pull request
Dec 10, 2020
OpenGL runtime will use raw type pointer to retrieve the uniform value in kernel args, so we have to use C-style type definition instead of GLSL-style. See also halide#4702
xndcn
added a commit
to xndcn/Halide
that referenced
this pull request
Dec 10, 2020
OpenGL runtime will use raw type pointer to retrieve the uniform value in kernel args, so we have to use C-style type definition instead of GLSL-style. See also halide#4702
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This turns on a few checkers for things clang-tidy considers bugprone. They are:
Calling a grandparent's virtual method instead of the parent
We did this in a few places, usually when there wasn't an override in the parent class, so it was fine. I think one of them was a bug though - CodeGen of atomics in opencl probably just skipped the atomic node and went straight to the body, because it called the IRVisitor visit override instead of the CodeGen_C override.
Constructing a string from 0 is UB
This happened in the unevaluated contexts in the LHS of the Generator operator overrides. Was introduced when we allowed
GeneratorParam<string>sizeof a pointer is considered a code smell, because often you're actually trying to take sizeof an array and failing. In this case it wasn't wrong, but it was a little confusing. Using a std::array seemed cleaner.