1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +01:00

[llvm] Use llvm::append_range (NFC)

This commit is contained in:
Kazu Hirata 2021-01-06 18:27:33 -08:00
parent 871d4c4165
commit 3109d596ee
20 changed files with 34 additions and 40 deletions

View File

@ -229,7 +229,7 @@ public:
if (*Node == N)
continue;
Node->findEdgesTo(N, TempList);
EL.insert(EL.end(), TempList.begin(), TempList.end());
llvm::append_range(EL, TempList);
TempList.clear();
}
return !EL.empty();

View File

@ -1126,7 +1126,7 @@ public:
explicit OperandBundleDefT(const OperandBundleUse &OBU) {
Tag = std::string(OBU.getTagName());
Inputs.insert(Inputs.end(), OBU.Inputs.begin(), OBU.Inputs.end());
llvm::append_range(Inputs, OBU.Inputs);
}
ArrayRef<InputTy> inputs() const { return Inputs; }

View File

@ -152,7 +152,7 @@ public:
// Add children present in the snapshot for not in the real CFG.
auto &AddedChildren = It->second.DI[1];
Res.insert(Res.end(), AddedChildren.begin(), AddedChildren.end());
llvm::append_range(Res, AddedChildren);
return Res;
}

View File

@ -6358,8 +6358,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
}
case bitc::FS_TYPE_TESTS:
assert(PendingTypeTests.empty());
PendingTypeTests.insert(PendingTypeTests.end(), Record.begin(),
Record.end());
llvm::append_range(PendingTypeTests, Record);
break;
case bitc::FS_TYPE_TEST_ASSUME_VCALLS:

View File

@ -3629,7 +3629,7 @@ static void writeFunctionTypeMetadataRecords(BitstreamWriter &Stream,
Record.clear();
Record.push_back(VC.VFunc.GUID);
Record.push_back(VC.VFunc.Offset);
Record.insert(Record.end(), VC.Args.begin(), VC.Args.end());
llvm::append_range(Record, VC.Args);
Stream.EmitRecord(Ty, Record);
}
};
@ -3703,7 +3703,7 @@ static void writeWholeProgramDevirtResolutionByArg(
SmallVector<uint64_t, 64> &NameVals, const std::vector<uint64_t> &args,
const WholeProgramDevirtResolution::ByArg &ByArg) {
NameVals.push_back(args.size());
NameVals.insert(NameVals.end(), args.begin(), args.end());
llvm::append_range(NameVals, args);
NameVals.push_back(ByArg.TheKind);
NameVals.push_back(ByArg.Info);

View File

@ -27,8 +27,7 @@ Error BitstreamCursor::EnterSubBlock(unsigned BlockID, unsigned *NumWordsP) {
if (BlockInfo) {
if (const BitstreamBlockInfo::BlockInfo *Info =
BlockInfo->getBlockInfo(BlockID)) {
CurAbbrevs.insert(CurAbbrevs.end(), Info->Abbrevs.begin(),
Info->Abbrevs.end());
llvm::append_range(CurAbbrevs, Info->Abbrevs);
}
}

View File

@ -1575,7 +1575,7 @@ static void insertLineSequence(std::vector<DWARFDebugLine::Row> &Seq,
return;
if (!Rows.empty() && Rows.back().Address < Seq.front().Address) {
Rows.insert(Rows.end(), Seq.begin(), Seq.end());
llvm::append_range(Rows, Seq);
Seq.clear();
return;
}

View File

@ -419,7 +419,7 @@ static GenericValue lle_X_printf(FunctionType *FT,
char Buffer[10000];
std::vector<GenericValue> NewArgs;
NewArgs.push_back(PTOGV((void*)&Buffer[0]));
NewArgs.insert(NewArgs.end(), Args.begin(), Args.end());
llvm::append_range(NewArgs, Args);
GenericValue GV = lle_X_sprintf(FT, NewArgs);
outs() << Buffer;
return GV;

View File

@ -1241,8 +1241,7 @@ void JITDylib::setLinkOrder(JITDylibSearchOrder NewLinkOrder,
if (NewLinkOrder.empty() || NewLinkOrder.front().first != this)
LinkOrder.push_back(
std::make_pair(this, JITDylibLookupFlags::MatchAllSymbols));
LinkOrder.insert(LinkOrder.end(), NewLinkOrder.begin(),
NewLinkOrder.end());
llvm::append_range(LinkOrder, NewLinkOrder);
} else
LinkOrder = std::move(NewLinkOrder);
});

View File

@ -1200,7 +1200,7 @@ AttributeList AttributeList::get(LLVMContext &C, AttributeSet FnAttrs,
if (NumSets > 2) {
// Drop the empty argument attribute sets at the end.
ArgAttrs = ArgAttrs.take_front(NumSets - 2);
AttrSets.insert(AttrSets.end(), ArgAttrs.begin(), ArgAttrs.end());
llvm::append_range(AttrSets, ArgAttrs);
}
return getImpl(C, AttrSets);

View File

@ -578,7 +578,7 @@ getStatepointArgs(IRBuilderBase &B, uint64_t ID, uint32_t NumPatchBytes,
Args.push_back(ActualCallee);
Args.push_back(B.getInt32(CallArgs.size()));
Args.push_back(B.getInt32(Flags));
Args.insert(Args.end(), CallArgs.begin(), CallArgs.end());
llvm::append_range(Args, CallArgs);
// GC Transition and Deopt args are now always handled via operand bundle.
// They will be removed from the signature of gc.statepoint shortly.
Args.push_back(B.getInt32(0));
@ -595,18 +595,17 @@ getStatepointBundles(Optional<ArrayRef<T1>> TransitionArgs,
std::vector<OperandBundleDef> Rval;
if (DeoptArgs) {
SmallVector<Value*, 16> DeoptValues;
DeoptValues.insert(DeoptValues.end(), DeoptArgs->begin(), DeoptArgs->end());
llvm::append_range(DeoptValues, *DeoptArgs);
Rval.emplace_back("deopt", DeoptValues);
}
if (TransitionArgs) {
SmallVector<Value*, 16> TransitionValues;
TransitionValues.insert(TransitionValues.end(),
TransitionArgs->begin(), TransitionArgs->end());
llvm::append_range(TransitionValues, *TransitionArgs);
Rval.emplace_back("gc-transition", TransitionValues);
}
if (GCArgs.size()) {
SmallVector<Value*, 16> LiveValues;
LiveValues.insert(LiveValues.end(), GCArgs.begin(), GCArgs.end());
llvm::append_range(LiveValues, GCArgs);
Rval.emplace_back("gc-live", LiveValues);
}
return Rval;

View File

@ -5975,7 +5975,7 @@ bool AsmParser::parseMSInlineAsm(
// Consider implicit defs to be clobbers. Think of cpuid and push.
ArrayRef<MCPhysReg> ImpDefs(Desc.getImplicitDefs(),
Desc.getNumImplicitDefs());
ClobberRegs.insert(ClobberRegs.end(), ImpDefs.begin(), ImpDefs.end());
llvm::append_range(ClobberRegs, ImpDefs);
}
// Set the number of Outputs and Inputs.

View File

@ -4044,8 +4044,7 @@ bool MasmParser::parseStructInstList(
return true;
for (int i = 0; i < Repetitions; ++i)
Initializers.insert(Initializers.end(), DuplicatedValues.begin(),
DuplicatedValues.end());
llvm::append_range(Initializers, DuplicatedValues);
} else {
Initializers.emplace_back();
if (parseStructInitializer(Structure, Initializers.back()))
@ -7119,7 +7118,7 @@ bool MasmParser::parseMSInlineAsm(
// Consider implicit defs to be clobbers. Think of cpuid and push.
ArrayRef<MCPhysReg> ImpDefs(Desc.getImplicitDefs(),
Desc.getNumImplicitDefs());
ClobberRegs.insert(ClobberRegs.end(), ImpDefs.begin(), ImpDefs.end());
llvm::append_range(ClobberRegs, ImpDefs);
}
// Set the number of Outputs and Inputs.

View File

@ -649,11 +649,11 @@ static void addData(SmallVectorImpl<char> &DataBytes,
Fill->getValue());
} else if (auto *LEB = dyn_cast<MCLEBFragment>(&Frag)) {
const SmallVectorImpl<char> &Contents = LEB->getContents();
DataBytes.insert(DataBytes.end(), Contents.begin(), Contents.end());
llvm::append_range(DataBytes, Contents);
} else {
const auto &DataFrag = cast<MCDataFragment>(Frag);
const SmallVectorImpl<char> &Contents = DataFrag.getContents();
DataBytes.insert(DataBytes.end(), Contents.begin(), Contents.end());
llvm::append_range(DataBytes, Contents);
}
}

View File

@ -241,7 +241,7 @@ void Scheduler::updateIssuedSet(SmallVectorImpl<InstRef> &Executed) {
}
uint64_t Scheduler::analyzeResourcePressure(SmallVectorImpl<InstRef> &Insts) {
Insts.insert(Insts.end(), ReadySet.begin(), ReadySet.end());
llvm::append_range(Insts, ReadySet);
return BusyResourceUnits;
}

View File

@ -616,8 +616,7 @@ public:
std::vector<StringRef> CoverageMapping::getUniqueSourceFiles() const {
std::vector<StringRef> Filenames;
for (const auto &Function : getCoveredFunctions())
Filenames.insert(Filenames.end(), Function.Filenames.begin(),
Function.Filenames.end());
llvm::append_range(Filenames, Function.Filenames);
llvm::sort(Filenames);
auto Last = std::unique(Filenames.begin(), Filenames.end());
Filenames.erase(Last, Filenames.end());

View File

@ -1349,7 +1349,7 @@ std::error_code SampleProfileReaderGCC::readOneFunctionProfile(
InlineCallStack NewStack;
NewStack.push_back(FProfile);
NewStack.insert(NewStack.end(), InlineStack.begin(), InlineStack.end());
llvm::append_range(NewStack, InlineStack);
if (Update) {
// Walk up the inline stack, adding the samples on this line to
// the total sample count of the callers in the chain.
@ -1397,7 +1397,7 @@ std::error_code SampleProfileReaderGCC::readOneFunctionProfile(
return sampleprof_error::truncated;
InlineCallStack NewStack;
NewStack.push_back(FProfile);
NewStack.insert(NewStack.end(), InlineStack.begin(), InlineStack.end());
llvm::append_range(NewStack, InlineStack);
if (std::error_code EC = readOneFunctionProfile(NewStack, Update, Offset))
return EC;
}

View File

@ -212,7 +212,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program,
return false;
}
EnvBlock.insert(EnvBlock.end(), EnvString.begin(), EnvString.end());
llvm::append_range(EnvBlock, EnvString);
EnvBlock.push_back(0);
}
EnvBlock.push_back(0);

View File

@ -715,7 +715,7 @@ std::string yaml::escape(StringRef Input, bool EscapePrintable) {
// Found invalid char.
SmallString<4> Val;
encodeUTF8(0xFFFD, Val);
EscapedInput.insert(EscapedInput.end(), Val.begin(), Val.end());
llvm::append_range(EscapedInput, Val);
// FIXME: Error reporting.
return EscapedInput;
}
@ -1984,11 +1984,11 @@ StringRef ScalarNode::getValue(SmallVectorImpl<char> &Storage) const {
Storage.reserve(UnquotedValue.size());
for (; i != StringRef::npos; i = UnquotedValue.find('\'')) {
StringRef Valid(UnquotedValue.begin(), i);
Storage.insert(Storage.end(), Valid.begin(), Valid.end());
llvm::append_range(Storage, Valid);
Storage.push_back('\'');
UnquotedValue = UnquotedValue.substr(i + 2);
}
Storage.insert(Storage.end(), UnquotedValue.begin(), UnquotedValue.end());
llvm::append_range(Storage, UnquotedValue);
return StringRef(Storage.begin(), Storage.size());
}
return UnquotedValue;
@ -2007,7 +2007,7 @@ StringRef ScalarNode::unescapeDoubleQuoted( StringRef UnquotedValue
for (; i != StringRef::npos; i = UnquotedValue.find_first_of("\\\r\n")) {
// Insert all previous chars into Storage.
StringRef Valid(UnquotedValue.begin(), i);
Storage.insert(Storage.end(), Valid.begin(), Valid.end());
llvm::append_range(Storage, Valid);
// Chop off inserted chars.
UnquotedValue = UnquotedValue.substr(i);
@ -2139,7 +2139,7 @@ StringRef ScalarNode::unescapeDoubleQuoted( StringRef UnquotedValue
UnquotedValue = UnquotedValue.substr(1);
}
}
Storage.insert(Storage.end(), UnquotedValue.begin(), UnquotedValue.end());
llvm::append_range(Storage, UnquotedValue);
return StringRef(Storage.begin(), Storage.size());
}

View File

@ -905,8 +905,8 @@ Init *BinOpInit::getStrConcat(Init *I0, Init *I1) {
static ListInit *ConcatListInits(const ListInit *LHS,
const ListInit *RHS) {
SmallVector<Init *, 8> Args;
Args.insert(Args.end(), LHS->begin(), LHS->end());
Args.insert(Args.end(), RHS->begin(), RHS->end());
llvm::append_range(Args, *LHS);
llvm::append_range(Args, *RHS);
return ListInit::get(Args, LHS->getElementType());
}
@ -959,8 +959,8 @@ Init *BinOpInit::Fold(Record *CurRec) const {
ListInit *RHSs = dyn_cast<ListInit>(RHS);
if (LHSs && RHSs) {
SmallVector<Init *, 8> Args;
Args.insert(Args.end(), LHSs->begin(), LHSs->end());
Args.insert(Args.end(), RHSs->begin(), RHSs->end());
llvm::append_range(Args, *LHSs);
llvm::append_range(Args, *RHSs);
return ListInit::get(Args, LHSs->getElementType());
}
break;