From 218dcdad8a0c0f3340a97dafa24456125fe9b4fb Mon Sep 17 00:00:00 2001 From: Jun Zhang Date: Sat, 9 Apr 2022 10:42:25 +0800 Subject: [PATCH] [Clang] Use std::move in GlobalModuleIndex::readIndex. NFC BitstreamCursors are heavy-weight objects that should not be passed by value. Differential Revision: https://reviews.llvm.org/D123436 --- clang/lib/Serialization/GlobalModuleIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 52ce17d984bf..b2283c2b3987 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -277,7 +277,7 @@ GlobalModuleIndex::readIndex(StringRef Path) { return std::make_pair(nullptr, Res.takeError()); } - return std::make_pair(new GlobalModuleIndex(std::move(Buffer), Cursor), + return std::make_pair(new GlobalModuleIndex(std::move(Buffer), std::move(Cursor)), llvm::Error::success()); }