[llvm] Use append_range (NFC)

This commit is contained in:
Kazu Hirata 2021-01-29 23:23:34 -08:00
parent 065bbe82a5
commit 04422f73a1
8 changed files with 12 additions and 24 deletions

View File

@ -302,10 +302,8 @@ public:
// If there is a blockinfo for this BlockID, add all the predefined abbrevs
// to the abbrev list.
if (BlockInfo *Info = getBlockInfo(BlockID)) {
CurAbbrevs.insert(CurAbbrevs.end(), Info->Abbrevs.begin(),
Info->Abbrevs.end());
}
if (BlockInfo *Info = getBlockInfo(BlockID))
append_range(CurAbbrevs, Info->Abbrevs);
}
void ExitBlock() {

View File

@ -564,8 +564,7 @@ protected:
// made to the CFG), so the PreViewCFG needs all the updates reverse
// applied.
SmallVector<UpdateType> AllUpdates(Updates.begin(), Updates.end());
for (auto &Update : PostViewUpdates)
AllUpdates.push_back(Update);
append_range(AllUpdates, PostViewUpdates);
GraphDiff<NodePtr, IsPostDom> PreViewCFG(AllUpdates,
/*ReverseApplyUpdates=*/true);
GraphDiff<NodePtr, IsPostDom> PostViewCFG(PostViewUpdates);

View File

@ -123,8 +123,7 @@ collectNestedBranches(const coverage::CoverageMapping &Coverage,
// Recursively collect branches from nested expansions.
auto NestedExpansions = ExpansionCoverage.getExpansions();
auto NestedExBranches = collectNestedBranches(Coverage, NestedExpansions);
Branches.insert(Branches.end(), NestedExBranches.begin(),
NestedExBranches.end());
append_range(Branches, NestedExBranches);
// Add branches from this level of expansion.
auto ExBranches = ExpansionCoverage.getBranches();

View File

@ -91,8 +91,7 @@ collectNestedBranches(const coverage::CoverageMapping &Coverage,
auto NestedExpansions = ExpansionCoverage.getExpansions();
auto NestedExBranches = collectNestedBranches(Coverage, NestedExpansions,
ViewDepth + 1, SrcLine);
Branches.insert(Branches.end(), NestedExBranches.begin(),
NestedExBranches.end());
append_range(Branches, NestedExBranches);
// Add branches from this level of expansion.
auto ExBranches = ExpansionCoverage.getBranches();
@ -123,7 +122,7 @@ void renderBranchExecutionCounts(raw_ostream &OS,
collectNestedBranches(Coverage, FileCoverage.getExpansions());
// Append Expansion Branches to Source Branches.
Branches.insert(Branches.end(), ExBranches.begin(), ExBranches.end());
append_range(Branches, ExBranches);
// Sort branches based on line number to ensure branches corresponding to the
// same source line are counted together.

View File

@ -593,8 +593,7 @@ void COFFDumper::cacheRelocations() {
for (const SectionRef &S : Obj->sections()) {
const coff_section *Section = Obj->getCOFFSection(S);
for (const RelocationRef &Reloc : S.relocations())
RelocMap[Section].push_back(Reloc);
append_range(RelocMap[Section], S.relocations());
// Sort relocations by address.
llvm::sort(RelocMap[Section], [](RelocationRef L, RelocationRef R) {

View File

@ -564,8 +564,7 @@ void thinlto_debug_options(const char *const *options, int number) {
// if options were requested, set them
if (number && options) {
std::vector<const char *> CodegenArgv(1, "libLTO");
for (auto Arg : ArrayRef<const char *>(options, number))
CodegenArgv.push_back(Arg);
append_range(CodegenArgv, ArrayRef<const char *>(options, number));
cl::ParseCommandLineOptions(CodegenArgv.size(), CodegenArgv.data());
}
}

View File

@ -329,9 +329,7 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() {
WasmYAML::ElemSegment Seg;
Seg.TableIndex = Segment.TableIndex;
Seg.Offset = Segment.Offset;
for (auto &Func : Segment.Functions) {
Seg.Functions.push_back(Func);
}
append_range(Seg.Functions, Segment.Functions);
ElemSec->Segments.push_back(Seg);
}
S = std::move(ElemSec);

View File

@ -745,14 +745,11 @@ int main(int argc, char **argv) {
}
FileCheckRequest Req;
for (StringRef Prefix : CheckPrefixes)
Req.CheckPrefixes.push_back(Prefix);
append_range(Req.CheckPrefixes, CheckPrefixes);
for (StringRef Prefix : CommentPrefixes)
Req.CommentPrefixes.push_back(Prefix);
append_range(Req.CommentPrefixes, CommentPrefixes);
for (StringRef CheckNot : ImplicitCheckNot)
Req.ImplicitCheckNot.push_back(CheckNot);
append_range(Req.ImplicitCheckNot, ImplicitCheckNot);
bool GlobalDefineError = false;
for (StringRef G : GlobalDefines) {