aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/FileCheck/FileCheckImpl.h
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2025-01-23 13:28:59 +0000
committerGitHub <noreply@github.com>2025-01-23 13:28:59 +0000
commitd3d605b7cdee132929d32f8b71b01641eb1d6d37 (patch)
tree63dac1c3a6335dc6ca29b29a449e7cdb2b661690 /llvm/lib/FileCheck/FileCheckImpl.h
parent590e5e20b12f9fd956d0ba7de83aa2ab44c9faeb (diff)
downloadllvm-d3d605b7cdee132929d32f8b71b01641eb1d6d37.zip
llvm-d3d605b7cdee132929d32f8b71b01641eb1d6d37.tar.gz
llvm-d3d605b7cdee132929d32f8b71b01641eb1d6d37.tar.bz2
[FileCheck] Use move semantics instead of std::swap. NFC. (#123304)
This code was using a pre-move-semantics trick of using std::swap to avoid expensive vector copies.
Diffstat (limited to 'llvm/lib/FileCheck/FileCheckImpl.h')
-rw-r--r--llvm/lib/FileCheck/FileCheckImpl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/FileCheck/FileCheckImpl.h b/llvm/lib/FileCheck/FileCheckImpl.h
index c772edd..4715fa9 100644
--- a/llvm/lib/FileCheck/FileCheckImpl.h
+++ b/llvm/lib/FileCheck/FileCheckImpl.h
@@ -837,8 +837,9 @@ struct FileCheckString {
/// Hold the DAG/NOT strings occurring in the input file.
std::vector<DagNotPrefixInfo> DagNotStrings;
- FileCheckString(const Pattern &P, StringRef S, SMLoc L)
- : Pat(P), Prefix(S), Loc(L) {}
+ FileCheckString(Pattern &&P, StringRef S, SMLoc L,
+ std::vector<DagNotPrefixInfo> &&D)
+ : Pat(std::move(P)), Prefix(S), Loc(L), DagNotStrings(std::move(D)) {}
/// Matches check string and its "not strings" and/or "dag strings".
size_t Check(const SourceMgr &SM, StringRef Buffer, bool IsLabelScanMode,