Skip to content

Commit 2e78fdf

Browse files
committed
Fix a bunch of pessimizing moves which prevent copy elision.
1 parent 689db17 commit 2e78fdf

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

lib/ClangImporter/ImporterImpl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
12141214
SmallVector<ProtocolConformance *, 4> result
12151215
= std::move(conformances->second);
12161216
DelayedConformances.erase(conformances);
1217-
return std::move(result);
1217+
return result;
12181218
}
12191219

12201220
/// Record the set of imported protocols for the given declaration,

lib/Driver/Driver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ Driver::buildOutputFileMap(const llvm::opt::DerivedArgList &Args) const {
13771377
// TODO: emit diagnostic with error string
13781378
Diags.diagnose(SourceLoc(), diag::error_unable_to_load_output_file_map);
13791379
}
1380-
return std::move(OFM);
1380+
return OFM;
13811381
}
13821382

13831383
void Driver::buildJobs(const ActionList &Actions, const OutputInfo &OI,

lib/IDE/Utils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
174174
break;
175175
}
176176
if (!IndentInfos.empty()) {
177-
SCR.IndentPrefix = std::move(IndentInfos.back().Prefix.str());
177+
SCR.IndentPrefix = IndentInfos.back().Prefix.str();
178178
// Trim off anything that follows a non-space character
179179
const size_t pos = SCR.IndentPrefix.find_first_not_of(" \t");
180180
if (pos != std::string::npos)

lib/SILGen/SILGenApply.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3208,7 +3208,7 @@ namespace {
32083208
// Reassign ArgValue.
32093209
RValue NewRValue = RValue(gen, ArgLoc, ArgTy.getSwiftRValueType(),
32103210
ArgManagedValue);
3211-
ArgValue = std::move(ArgumentSource(ArgLoc, std::move(NewRValue)));
3211+
ArgValue = ArgumentSource(ArgLoc, std::move(NewRValue));
32123212
}
32133213
};
32143214

lib/SILGen/SILGenProlog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class EmitBBArguments : public CanTypeVisitor<EmitBBArguments,
9696
// An unowned parameter is passed at +0, like guaranteed, but it isn't
9797
// kept alive by the caller, so we need to retain and manage it
9898
// regardless.
99-
return std::move(gen.emitManagedRetain(loc, arg));
99+
return gen.emitManagedRetain(loc, arg);
100100

101101
case ParameterConvention::Indirect_Inout:
102102
case ParameterConvention::Indirect_InoutAliasable:

tools/swift-ide-test/ModuleAPIDiff.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ class SMAModelGenerator : public DeclVisitor<SMAModelGenerator> {
730730
sma::TypeName ResultTN;
731731
llvm::raw_string_ostream OS(ResultTN.Name);
732732
T.print(OS, Options);
733-
return std::move(ResultTN);
733+
return ResultTN;
734734
}
735735

736736
llvm::Optional<sma::TypeName> convertToOptionalTypeName(Type T) const {

0 commit comments

Comments
 (0)