[TableGen] Use llvm::append_range (NFC) (#133649)

This commit is contained in:
Kazu Hirata
2025-03-30 12:21:38 -07:00
committed by GitHub
parent 1c8647a25a
commit 2c73711995
3 changed files with 9 additions and 22 deletions

View File

@@ -113,9 +113,7 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
ParamTypeRecs.push_back(R->getValueAsDef("result"));
for (const Record *ArgTy : R->getValueAsListOfDefs("arguments")) {
ParamTypeRecs.push_back(ArgTy);
}
llvm::append_range(ParamTypeRecs, R->getValueAsListOfDefs("arguments"));
size_t ParamTypeRecsSize = ParamTypeRecs.size();
// Populate OpTypes with return type and parameter types
@@ -148,9 +146,7 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
// Sort records in ascending order of DXIL version
ascendingSortByVersion(Recs);
for (const Record *CR : Recs) {
OverloadRecs.push_back(CR);
}
llvm::append_range(OverloadRecs, Recs);
// Get stage records
Recs = R->getValueAsListOfDefs("stages");
@@ -163,9 +159,7 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
// Sort records in ascending order of DXIL version
ascendingSortByVersion(Recs);
for (const Record *CR : Recs) {
StageRecs.push_back(CR);
}
llvm::append_range(StageRecs, Recs);
// Get attribute records
Recs = R->getValueAsListOfDefs("attributes");
@@ -173,9 +167,7 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
// Sort records in ascending order of DXIL version
ascendingSortByVersion(Recs);
for (const Record *CR : Recs) {
AttrRecs.push_back(CR);
}
llvm::append_range(AttrRecs, Recs);
// Get the operation class
OpClass = R->getValueAsDef("OpClass")->getName();

View File

@@ -1342,8 +1342,7 @@ void FilterChooser::emitPredicateTableEntry(DecoderTableInfo &TableInfo,
TableInfo.Table.push_back(MCD::OPC_CheckPredicate);
// Predicate index.
for (const auto PB : PBytes)
TableInfo.Table.push_back(PB);
llvm::append_range(TableInfo.Table, PBytes);
// Push location for NumToSkip backpatching.
TableInfo.FixupStack.back().push_back(TableInfo.Table.size());
TableInfo.Table.push_back(0);
@@ -1402,15 +1401,13 @@ void FilterChooser::emitSoftFailTableEntry(DecoderTableInfo &TableInfo,
raw_svector_ostream S(MaskBytes);
if (NeedPositiveMask) {
encodeULEB128(PositiveMask.getZExtValue(), S);
for (unsigned i = 0, e = MaskBytes.size(); i != e; ++i)
TableInfo.Table.push_back(MaskBytes[i]);
llvm::append_range(TableInfo.Table, MaskBytes);
} else
TableInfo.Table.push_back(0);
if (NeedNegativeMask) {
MaskBytes.clear();
encodeULEB128(NegativeMask.getZExtValue(), S);
for (unsigned i = 0, e = MaskBytes.size(); i != e; ++i)
TableInfo.Table.push_back(MaskBytes[i]);
llvm::append_range(TableInfo.Table, MaskBytes);
} else
TableInfo.Table.push_back(0);
}
@@ -1483,8 +1480,7 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
encodeULEB128(DIdx, S);
// Decoder index.
for (const auto B : Bytes)
TableInfo.Table.push_back(B);
llvm::append_range(TableInfo.Table, Bytes);
if (!HasCompleteDecoder) {
// Push location for NumToSkip backpatching.

View File

@@ -746,8 +746,7 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2,
ModRMDecision.push_back(decision.instructionIDs[index]);
break;
case MODRM_FULL:
for (unsigned short InstructionID : decision.instructionIDs)
ModRMDecision.push_back(InstructionID);
llvm::append_range(ModRMDecision, decision.instructionIDs);
break;
}