1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

[tools] Use llvm::append_range (NFC)

This commit is contained in:
Kazu Hirata 2021-01-05 21:15:56 -08:00
parent f0d6cc1d99
commit b753882cc3
7 changed files with 7 additions and 12 deletions

View File

@ -495,7 +495,7 @@ Expected<int> LLC::ExecuteProgram(const std::string &Bitcode,
return std::move(E); return std::move(E);
std::vector<std::string> CCArgs(ArgsForCC); std::vector<std::string> CCArgs(ArgsForCC);
CCArgs.insert(CCArgs.end(), SharedLibs.begin(), SharedLibs.end()); llvm::append_range(CCArgs, SharedLibs);
// Assuming LLC worked, compile the result with CC and run it. // Assuming LLC worked, compile the result with CC and run it.
return cc->ExecuteProgram(OutputAsmFile, Args, *FileKind, InputFile, return cc->ExecuteProgram(OutputAsmFile, Args, *FileKind, InputFile,

View File

@ -62,8 +62,7 @@ int main(int argc, char **argv) {
errorOrToExpected(MemoryBuffer::getFileOrSTDIN(InputFilename))); errorOrToExpected(MemoryBuffer::getFileOrSTDIN(InputFilename)));
std::vector<BitcodeModule> Mods = ExitOnErr(getBitcodeModuleList(*MB)); std::vector<BitcodeModule> Mods = ExitOnErr(getBitcodeModuleList(*MB));
for (auto &BitcodeMod : Mods) { for (auto &BitcodeMod : Mods) {
Buffer.insert(Buffer.end(), BitcodeMod.getBuffer().begin(), llvm::append_range(Buffer, BitcodeMod.getBuffer());
BitcodeMod.getBuffer().end());
Writer.copyStrtab(BitcodeMod.getStrtab()); Writer.copyStrtab(BitcodeMod.getStrtab());
} }
} }

View File

@ -670,7 +670,7 @@ int main(int argc, char **argv) {
std::vector<std::string> Objects; std::vector<std::string> Objects;
for (const auto &F : InputFilenames) { for (const auto &F : InputFilenames) {
auto Objs = expandBundle(F); auto Objs = expandBundle(F);
Objects.insert(Objects.end(), Objs.begin(), Objs.end()); llvm::append_range(Objects, Objs);
} }
bool Success = true; bool Success = true;

View File

@ -182,9 +182,7 @@ Expected<InstructionBenchmark> BenchmarkRunner::runConfiguration(
const ExecutableFunction EF(State.createTargetMachine(), const ExecutableFunction EF(State.createTargetMachine(),
getObjectFromBuffer(OS.str())); getObjectFromBuffer(OS.str()));
const auto FnBytes = EF.getFunctionBytes(); const auto FnBytes = EF.getFunctionBytes();
InstrBenchmark.AssembledSnippet.insert( llvm::append_range(InstrBenchmark.AssembledSnippet, FnBytes);
InstrBenchmark.AssembledSnippet.end(), FnBytes.begin(),
FnBytes.end());
} }
// Assemble NumRepetitions instructions repetitions of the snippet for // Assemble NumRepetitions instructions repetitions of the snippet for

View File

@ -416,7 +416,7 @@ static llvm::Error convertFileToGSYM(raw_ostream &OS) {
OS << "Input file: " << ConvertFilename << "\n"; OS << "Input file: " << ConvertFilename << "\n";
auto Objs = expandBundle(ConvertFilename); auto Objs = expandBundle(ConvertFilename);
Objects.insert(Objects.end(), Objs.begin(), Objs.end()); llvm::append_range(Objects, Objs);
for (auto Object : Objects) { for (auto Object : Objects) {
if (auto Err = handleFileConversionToGSYM(Object, OutFile)) if (auto Err = handleFileConversionToGSYM(Object, OutFile))

View File

@ -315,8 +315,7 @@ protected:
Type::getFloatTy(Context), Type::getFloatTy(Context),
Type::getDoubleTy(Context) Type::getDoubleTy(Context)
}); });
ScalarTypes.insert(ScalarTypes.end(), llvm::append_range(ScalarTypes, AdditionalScalarTypes);
AdditionalScalarTypes.begin(), AdditionalScalarTypes.end());
} }
return ScalarTypes[getRandom() % ScalarTypes.size()]; return ScalarTypes[getRandom() % ScalarTypes.size()];

View File

@ -312,8 +312,7 @@ void GraphRenderer::calculateVertexStatistics() {
if (V.first != 0) { if (V.first != 0) {
for (auto &E : G.inEdges(V.first)) { for (auto &E : G.inEdges(V.first)) {
auto &A = E.second; auto &A = E.second;
TempTimings.insert(TempTimings.end(), A.Timings.begin(), llvm::append_range(TempTimings, A.Timings);
A.Timings.end());
} }
getStats(TempTimings.begin(), TempTimings.end(), G[V.first].S); getStats(TempTimings.begin(), TempTimings.end(), G[V.first].S);
updateMaxStats(G[V.first].S, G.GraphVertexMax); updateMaxStats(G[V.first].S, G.GraphVertexMax);