[PATCH] D156474: [-Wunsafe-buffer-usage][NFC] Slightly refactor and optimize the code
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 1 15:13:48 PDT 2023
NoQ added inline comments.
================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:1143
+ // order is deterministic:
+ CompareNode<VarDecl>>
+ byVar;
----------------
ziqingluo-90 wrote:
> To make the order of variables in every group deterministic.
Would it make sense to immediately clean up the regexps in tests then?
================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2318-2319
if (ImplPair) {
- std::pair<const VarDecl *, const VarDecl *> Impl = ImplPair.value();
+ std::pair<const VarDecl *, const VarDecl *> Impl = std::move(*ImplPair);
PtrAssignmentGraph[Impl.first].insert(Impl.second);
}
----------------
These objects don't really define any move semantics, so `std::move` is probably redundant.
Maybe structured binding instead?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156474/new/
https://reviews.llvm.org/D156474
More information about the cfe-commits
mailing list