mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix a bunch of pessimizing moves which prevent copy elision.
This commit is contained in:
@@ -1214,7 +1214,7 @@ public:
|
|||||||
SmallVector<ProtocolConformance *, 4> result
|
SmallVector<ProtocolConformance *, 4> result
|
||||||
= std::move(conformances->second);
|
= std::move(conformances->second);
|
||||||
DelayedConformances.erase(conformances);
|
DelayedConformances.erase(conformances);
|
||||||
return std::move(result);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Record the set of imported protocols for the given declaration,
|
/// Record the set of imported protocols for the given declaration,
|
||||||
|
|||||||
@@ -1377,7 +1377,7 @@ Driver::buildOutputFileMap(const llvm::opt::DerivedArgList &Args) const {
|
|||||||
// TODO: emit diagnostic with error string
|
// TODO: emit diagnostic with error string
|
||||||
Diags.diagnose(SourceLoc(), diag::error_unable_to_load_output_file_map);
|
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,
|
void Driver::buildJobs(const ActionList &Actions, const OutputInfo &OI,
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!IndentInfos.empty()) {
|
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
|
// Trim off anything that follows a non-space character
|
||||||
const size_t pos = SCR.IndentPrefix.find_first_not_of(" \t");
|
const size_t pos = SCR.IndentPrefix.find_first_not_of(" \t");
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
|
|||||||
@@ -3208,7 +3208,7 @@ namespace {
|
|||||||
// Reassign ArgValue.
|
// Reassign ArgValue.
|
||||||
RValue NewRValue = RValue(gen, ArgLoc, ArgTy.getSwiftRValueType(),
|
RValue NewRValue = RValue(gen, ArgLoc, ArgTy.getSwiftRValueType(),
|
||||||
ArgManagedValue);
|
ArgManagedValue);
|
||||||
ArgValue = std::move(ArgumentSource(ArgLoc, std::move(NewRValue)));
|
ArgValue = ArgumentSource(ArgLoc, std::move(NewRValue));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
// An unowned parameter is passed at +0, like guaranteed, but it isn't
|
// 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
|
// kept alive by the caller, so we need to retain and manage it
|
||||||
// regardless.
|
// regardless.
|
||||||
return std::move(gen.emitManagedRetain(loc, arg));
|
return gen.emitManagedRetain(loc, arg);
|
||||||
|
|
||||||
case ParameterConvention::Indirect_Inout:
|
case ParameterConvention::Indirect_Inout:
|
||||||
case ParameterConvention::Indirect_InoutAliasable:
|
case ParameterConvention::Indirect_InoutAliasable:
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ public:
|
|||||||
sma::TypeName ResultTN;
|
sma::TypeName ResultTN;
|
||||||
llvm::raw_string_ostream OS(ResultTN.Name);
|
llvm::raw_string_ostream OS(ResultTN.Name);
|
||||||
T.print(OS, Options);
|
T.print(OS, Options);
|
||||||
return std::move(ResultTN);
|
return ResultTN;
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::Optional<sma::TypeName> convertToOptionalTypeName(Type T) const {
|
llvm::Optional<sma::TypeName> convertToOptionalTypeName(Type T) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user