[clang] cppcheck: use move semantics for 'NodeKinds' and update possible callers to use it (PR #87273)
Amila Senadheera via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 19 23:15:38 PDT 2024
https://github.com/Amila-Rukshan updated https://github.com/llvm/llvm-project/pull/87273
>From d85a9656d72e6380171f25c79cb4454b694286da Mon Sep 17 00:00:00 2001
From: amila <amila.15 at cse.mrt.ac.lk>
Date: Tue, 2 Apr 2024 00:15:59 +0530
Subject: [PATCH] use move semantics for NodeKinds and update possible callers
to use it
Signed-off-by: amila <amila.15 at cse.mrt.ac.lk>
---
clang/lib/ASTMatchers/Dynamic/Marshallers.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/ASTMatchers/Dynamic/Marshallers.h b/clang/lib/ASTMatchers/Dynamic/Marshallers.h
index c76ddf17b719d4..0e640cbada7268 100644
--- a/clang/lib/ASTMatchers/Dynamic/Marshallers.h
+++ b/clang/lib/ASTMatchers/Dynamic/Marshallers.h
@@ -937,7 +937,7 @@ class MapAnyOfMatcherDescriptor : public MatcherDescriptor {
public:
MapAnyOfMatcherDescriptor(ASTNodeKind CladeNodeKind,
std::vector<ASTNodeKind> NodeKinds)
- : CladeNodeKind(CladeNodeKind), NodeKinds(NodeKinds) {}
+ : CladeNodeKind(CladeNodeKind), NodeKinds(std::move(NodeKinds)) {}
VariantMatcher create(SourceRange NameRange, ArrayRef<ParserValue> Args,
Diagnostics *Error) const override {
@@ -1026,7 +1026,7 @@ class MapAnyOfBuilderDescriptor : public MatcherDescriptor {
}
return std::make_unique<MapAnyOfMatcherDescriptor>(CladeNodeKind,
- NodeKinds);
+ std::move(NodeKinds));
}
bool isVariadic() const override { return true; }
More information about the cfe-commits
mailing list