Skip to content

Fix a bunch of pessimizing moves which prevent copy elision. #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ClangImporter/ImporterImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
SmallVector<ProtocolConformance *, 4> result
= std::move(conformances->second);
DelayedConformances.erase(conformances);
return std::move(result);
return result;
}

/// Record the set of imported protocols for the given declaration,
Expand Down
2 changes: 1 addition & 1 deletion lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ Driver::buildOutputFileMap(const llvm::opt::DerivedArgList &Args) const {
// TODO: emit diagnostic with error string
Diags.diagnose(SourceLoc(), diag::error_unable_to_load_output_file_map);
}
return std::move(OFM);
return OFM;
}

void Driver::buildJobs(const ActionList &Actions, const OutputInfo &OI,
Expand Down
2 changes: 1 addition & 1 deletion lib/IDE/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
break;
}
if (!IndentInfos.empty()) {
SCR.IndentPrefix = std::move(IndentInfos.back().Prefix.str());
SCR.IndentPrefix = IndentInfos.back().Prefix.str();
// Trim off anything that follows a non-space character
const size_t pos = SCR.IndentPrefix.find_first_not_of(" \t");
if (pos != std::string::npos)
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,7 @@ namespace {
// Reassign ArgValue.
RValue NewRValue = RValue(gen, ArgLoc, ArgTy.getSwiftRValueType(),
ArgManagedValue);
ArgValue = std::move(ArgumentSource(ArgLoc, std::move(NewRValue)));
ArgValue = ArgumentSource(ArgLoc, std::move(NewRValue));
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenProlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class EmitBBArguments : public CanTypeVisitor<EmitBBArguments,
// An unowned parameter is passed at +0, like guaranteed, but it isn't
// kept alive by the caller, so we need to retain and manage it
// regardless.
return std::move(gen.emitManagedRetain(loc, arg));
return gen.emitManagedRetain(loc, arg);

case ParameterConvention::Indirect_Inout:
case ParameterConvention::Indirect_InoutAliasable:
Expand Down
2 changes: 1 addition & 1 deletion tools/swift-ide-test/ModuleAPIDiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ class SMAModelGenerator : public DeclVisitor<SMAModelGenerator> {
sma::TypeName ResultTN;
llvm::raw_string_ostream OS(ResultTN.Name);
T.print(OS, Options);
return std::move(ResultTN);
return ResultTN;
}

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