[llvm-branch-commits] [llvm] 441650d - [tools] Use llvm::append_range (NFC)
Kazu Hirata via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jan 5 21:22:13 PST 2021
Author: Kazu Hirata
Date: 2021-01-05T21:15:56-08:00
New Revision: 441650d5893001f18a0bb9440ea32f6bd2039196
URL: https://github.com/llvm/llvm-project/commit/441650d5893001f18a0bb9440ea32f6bd2039196
DIFF: https://github.com/llvm/llvm-project/commit/441650d5893001f18a0bb9440ea32f6bd2039196.diff
LOG: [tools] Use llvm::append_range (NFC)
Added:
Modified:
llvm/tools/bugpoint/ToolRunner.cpp
llvm/tools/llvm-cat/llvm-cat.cpp
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
llvm/tools/llvm-stress/llvm-stress.cpp
llvm/tools/llvm-xray/xray-graph.cpp
Removed:
################################################################################
diff --git a/llvm/tools/bugpoint/ToolRunner.cpp b/llvm/tools/bugpoint/ToolRunner.cpp
index d880aca044d1..c4ea1dad122b 100644
--- a/llvm/tools/bugpoint/ToolRunner.cpp
+++ b/llvm/tools/bugpoint/ToolRunner.cpp
@@ -495,7 +495,7 @@ Expected<int> LLC::ExecuteProgram(const std::string &Bitcode,
return std::move(E);
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.
return cc->ExecuteProgram(OutputAsmFile, Args, *FileKind, InputFile,
diff --git a/llvm/tools/llvm-cat/llvm-cat.cpp b/llvm/tools/llvm-cat/llvm-cat.cpp
index 85f2b410f870..39848e5d3364 100644
--- a/llvm/tools/llvm-cat/llvm-cat.cpp
+++ b/llvm/tools/llvm-cat/llvm-cat.cpp
@@ -62,8 +62,7 @@ int main(int argc, char **argv) {
errorOrToExpected(MemoryBuffer::getFileOrSTDIN(InputFilename)));
std::vector<BitcodeModule> Mods = ExitOnErr(getBitcodeModuleList(*MB));
for (auto &BitcodeMod : Mods) {
- Buffer.insert(Buffer.end(), BitcodeMod.getBuffer().begin(),
- BitcodeMod.getBuffer().end());
+ llvm::append_range(Buffer, BitcodeMod.getBuffer());
Writer.copyStrtab(BitcodeMod.getStrtab());
}
}
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index abaf3140bcfb..4322f125a84d 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -670,7 +670,7 @@ int main(int argc, char **argv) {
std::vector<std::string> Objects;
for (const auto &F : InputFilenames) {
auto Objs = expandBundle(F);
- Objects.insert(Objects.end(), Objs.begin(), Objs.end());
+ llvm::append_range(Objects, Objs);
}
bool Success = true;
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
index 2304e91b8b32..f3ce184b4e93 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -182,9 +182,7 @@ Expected<InstructionBenchmark> BenchmarkRunner::runConfiguration(
const ExecutableFunction EF(State.createTargetMachine(),
getObjectFromBuffer(OS.str()));
const auto FnBytes = EF.getFunctionBytes();
- InstrBenchmark.AssembledSnippet.insert(
- InstrBenchmark.AssembledSnippet.end(), FnBytes.begin(),
- FnBytes.end());
+ llvm::append_range(InstrBenchmark.AssembledSnippet, FnBytes);
}
// Assemble NumRepetitions instructions repetitions of the snippet for
diff --git a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
index b1dd5482938b..155eee07e055 100644
--- a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
+++ b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
@@ -416,7 +416,7 @@ static llvm::Error convertFileToGSYM(raw_ostream &OS) {
OS << "Input file: " << ConvertFilename << "\n";
auto Objs = expandBundle(ConvertFilename);
- Objects.insert(Objects.end(), Objs.begin(), Objs.end());
+ llvm::append_range(Objects, Objs);
for (auto Object : Objects) {
if (auto Err = handleFileConversionToGSYM(Object, OutFile))
diff --git a/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp
index 10ebc1fbf81c..538240d65738 100644
--- a/llvm/tools/llvm-stress/llvm-stress.cpp
+++ b/llvm/tools/llvm-stress/llvm-stress.cpp
@@ -315,8 +315,7 @@ struct Modifier {
Type::getFloatTy(Context),
Type::getDoubleTy(Context)
});
- ScalarTypes.insert(ScalarTypes.end(),
- AdditionalScalarTypes.begin(), AdditionalScalarTypes.end());
+ llvm::append_range(ScalarTypes, AdditionalScalarTypes);
}
return ScalarTypes[getRandom() % ScalarTypes.size()];
diff --git a/llvm/tools/llvm-xray/xray-graph.cpp b/llvm/tools/llvm-xray/xray-graph.cpp
index 522609b938f2..00a1807c07c9 100644
--- a/llvm/tools/llvm-xray/xray-graph.cpp
+++ b/llvm/tools/llvm-xray/xray-graph.cpp
@@ -312,8 +312,7 @@ void GraphRenderer::calculateVertexStatistics() {
if (V.first != 0) {
for (auto &E : G.inEdges(V.first)) {
auto &A = E.second;
- TempTimings.insert(TempTimings.end(), A.Timings.begin(),
- A.Timings.end());
+ llvm::append_range(TempTimings, A.Timings);
}
getStats(TempTimings.begin(), TempTimings.end(), G[V.first].S);
updateMaxStats(G[V.first].S, G.GraphVertexMax);
More information about the llvm-branch-commits
mailing list