Skip to content

Conversation

@kidq330
Copy link

@kidq330 kidq330 commented Jan 14, 2025

Closes #22583

As pointed out in the discussion under the linked issue, the semantics of this check are a little tricky to pin down exactly so this version offers a little less than I'd like and hoping someone with more experience could help.
Other notes:

  • Tried my hand at setting up a developer env using a nix flake which was semi-successful, but I wasn't able to add libedit in a way that didn't break compilation, throwing this out here in case someone reading this uses a similar setup and has some pointers
  • Also discussed in the linked issue, a similar check can be made to replace memset with std::fill. I'll try to create a tracking issue before this one gets merged, hopefully, and would be willing to work on it as well since they share a lot of aspects.

First contribution so I'd say it will need some post-review fixes

@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@kadircet
Copy link
Member

can you update clang-tools-extra/clangd/TidyFastChecks.inc in a follow up change, after this check lands in its final shape?

@kidq330
Copy link
Author

kidq330 commented Jan 15, 2025

@kadircet Does the file need further changes from what I've already added?

@kadircet
Copy link
Member

@kadircet Does the file need further changes from what I've already added?

probably yes, it'd be great if you can just run https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clangd/TidyFastChecks.py to generate the edits

@kidq330
Copy link
Author

kidq330 commented Feb 8, 2025

@kadircet I ran the script but it seems that my check was one of the few that did not get updated (see last commit in PR), is this normal?
Here's the cmake command for the build I used:

cmake -G Ninja -S llvm -B static  -DBUILD_SHARED_LIBS=false -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE="Release" -DLLVM_USE_LINKER=mold -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++"

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.

Replace memcpy with std::copy

3 participants