Skip to content

Clang tidy bugprone checkers#4702

Merged
abadams merged 5 commits intomasterfrom
clang_tidy_bugprone
Mar 13, 2020
Merged

Clang tidy bugprone checkers#4702
abadams merged 5 commits intomasterfrom
clang_tidy_bugprone

Conversation

@abadams
Copy link
Member

@abadams abadams commented Mar 11, 2020

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.

abadams added 2 commits March 11, 2020 15:30
- 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
@abadams abadams merged commit b93cbbd into master Mar 13, 2020
@abadams abadams deleted the clang_tidy_bugprone branch May 22, 2020 16:55
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants