This revision was automatically updated to reflect the committed changes.
Closed by commit rL303157: [clang-tidy] Add "emplace_back" detection in
inefficient-vector-operation. (authored by hokein).
Changed prior to commit:
https://reviews.llvm.org/D33209?vs=99124=99127#toc
Repository:
rL
hokein added inline comments.
Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:50
+static const char PushBackOrEmplaceBackCallName[] =
+"push_back_or_emplace_back_call";
static const char LoopInitVarName[] = "loop_init_var";
alexfh
hokein updated this revision to Diff 99124.
hokein marked 3 inline comments as done.
hokein added a comment.
Improve tests.
https://reviews.llvm.org/D33209
Files:
clang-tidy/performance/InefficientVectorOperationCheck.cpp
docs/clang-tidy/checks/performance-inefficient-vector-operation.rst
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
LG once the comments are addressed.
https://reviews.llvm.org/D33209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
alexfh added inline comments.
Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:208
+ "consider pre-allocating the vector capacity before the loop")
+ << VectorAppendCall->getMethodDecl()->getDeclName();
hokein wrote:
>
hokein marked an inline comment as done.
hokein added inline comments.
Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:92
+ const auto VectorAppendCall = expr(
+ anyOf(VectorAppendCallExpr,
exprWithCleanups(has(VectorAppendCallExpr;
const
hokein updated this revision to Diff 99119.
hokein marked an inline comment as done.
hokein added a comment.
Adress review comments.
https://reviews.llvm.org/D33209
Files:
clang-tidy/performance/InefficientVectorOperationCheck.cpp
alexfh added inline comments.
Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:208
+ "consider pre-allocating the vector capacity before the loop")
+ << VectorAppendCall->getMethodDecl()->getDeclName();
Diagnostic builder
malcolm.parsons added a subscriber: cfe-commits.
malcolm.parsons added inline comments.
Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:92
+ const auto VectorAppendCall = expr(
+ anyOf(VectorAppendCallExpr,