- User Since
- Jun 6 2022, 10:47 AM (68 w, 5 d)
Jan 16 2023
revert changes to JITLink
Fixup one another cpp error
Make jitlink cpp match
Fix another forward declare
Fix forward declare typo
Fix forward declare typo
Fixed forward declare bug
Made sure headers updated too. Skip support and ADT files for now.
Jan 15 2023
Jan 12 2023
I am trying this in the wild and getting some false positives where it tries to call std::move inside loop conditions and in the boolean condition for an if statement. Stuff like:
Dec 18 2022
Pinging @njames93 to about the questions from the previous comment. Would love to see something like this PR get merged.
Nov 22 2022
Nov 13 2022
The main false positive I also keep seeing is in pybind11 where it suggests call an std::move() for an implicit conversion, but the target of the implicit conversion does not have an rvalue. (In this case, we have a py::object which inherits from py::handle, and is just py::handle with ownership semantics. This allows implicit conversion to a reference at anytime, and therefore std::move has no effect here except to complicate the code a bit.
Nov 9 2022
Hmm, I still had a crash on this latest code (although it is crashing much more rarely now.
Currently, this check also tries to move static values which is very undesirable and unlikely to be correct.
static auto value = std::string("CONSTANT"); - return value; + return std::move(value);
Nov 8 2022
Okay, now I am getting what I believe to be segfaults:
#0 0x0000564383482be4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0 #1 0x0000564383480464 SignalHandler(int) Signals.cpp:0:0 #2 0x00007f7c275c9420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420) #3 0x00005643804b0ea5 clang::tidy::performance::UnnecessaryCopyOnLastUseCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (.cold) UnnecessaryCopyOnLastUseCheck.cpp:0:0 #4 0x000056438262bba1 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) ASTMatchFinder.cpp:0:0 #5 0x00005643826818df clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/home/aaron/git/llvm-project/build/bin/clang-tidy+0x2d258df)
It worked before this PR, now it just crashes on a lot of real world codebases including just trying to run it for a few files on LLVM's own codebase.
Nov 7 2022
One other bug I found with this diff, is it seems to suggest calling std::move() on function args that are references, despite the fact that invalidating the reference to the input arg could be undesirable. For instance take a function that takes in a reference to a String, assigns a new value to the arg reference, and then returns the value of the reference. It suggests calling std::move() on the arg ref when it is returned, which invalidate the reference to the argument.
Nov 3 2022
I noticed one other bug from testing this out on some C++ codebases.
Use llvm::find_if instead of std::find_if