Skip to content

Commit 6f48502

Browse files
authored
[NFC]Avoid std::move local objects and fix ctad warning (#18297)
1 parent 557b36a commit 6f48502

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ Expected<SmallVector<StringRef>> linkAndWrapDeviceFiles(
21362136
SYCLBIN::SYCLBINModuleDesc MD;
21372137
MD.ArchString = LinkerArgs.getLastArgValue(OPT_arch_EQ);
21382138
MD.SplitModules = std::move(SplitModules);
2139-
std::scoped_lock Guard(SYCLBINModulesMtx);
2139+
std::scoped_lock<std::mutex> Guard(SYCLBINModulesMtx);
21402140
SYCLBINModules.emplace_back(std::move(MD));
21412141
} else {
21422142
// TODO(NOM7): Remove this call and use community flow for bundle/wrap

llvm/lib/Object/SYCLBIN.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Error SYCLBIN::write(const SYCLBIN::SYCLBINDesc &Desc, raw_ostream &OS) {
205205
FileHeader.MetadataByteTableSize = Desc.getMetadataTableByteSize();
206206
if (Error E = Desc.getBinaryTableByteSize().moveInto(
207207
FileHeader.BinaryByteTableSize))
208-
return std::move(E);
208+
return E;
209209
OS << StringRef(reinterpret_cast<char *>(&FileHeader), sizeof(FileHeader));
210210
OS.write_zeros(alignTo(OS.tell(), 8) - OS.tell());
211211
HeaderTrackedMetadataOffset += FileHeader.GlobalMetadataSize;

llvm/unittests/Object/SYCLBINTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ManagedBinaryFile {
4444
std::unique_ptr<FileOutputBuffer> Output = std::move(*OutputOrErr);
4545
llvm::copy(Data, Output->getBufferStart());
4646
if (Error E = Output->commit())
47-
return std::move(E);
47+
return E;
4848

4949
return std::move(ManagedFile);
5050
}
@@ -63,7 +63,7 @@ std::vector<uint8_t> generateRandomImage() {
6363
std::numeric_limits<uint8_t>::min(), std::numeric_limits<uint8_t>::max());
6464
std::vector<uint8_t> Image(SizeDist(Rng));
6565
std::generate(Image.begin(), Image.end(), [&]() { return BinaryDist(Rng); });
66-
return std::move(Image);
66+
return Image;
6767
}
6868

6969
} // namespace

0 commit comments

Comments
 (0)