mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
[TableGen] Use range-based for loops. NFC
llvm-svn: 260502
This commit is contained in:
parent
6f4a255e72
commit
afb65fa73d
@ -499,8 +499,7 @@ static void emitEnums(raw_ostream &OS, RecordKeeper &Records) {
|
|||||||
|
|
||||||
// Iterate over all InstrMapping records and create a map between column
|
// Iterate over all InstrMapping records and create a map between column
|
||||||
// fields and their possible values across all records.
|
// fields and their possible values across all records.
|
||||||
for (unsigned i = 0, e = InstrMapVec.size(); i < e; i++) {
|
for (Record *CurMap : InstrMapVec) {
|
||||||
Record *CurMap = InstrMapVec[i];
|
|
||||||
ListInit *ColFields;
|
ListInit *ColFields;
|
||||||
ColFields = CurMap->getValueAsListInit("ColFields");
|
ColFields = CurMap->getValueAsListInit("ColFields");
|
||||||
ListInit *List = CurMap->getValueAsListInit("ValueCols");
|
ListInit *List = CurMap->getValueAsListInit("ValueCols");
|
||||||
@ -524,10 +523,8 @@ static void emitEnums(raw_ostream &OS, RecordKeeper &Records) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::map<std::string, std::vector<Init*> >::iterator
|
for (auto &Entry : ColFieldValueMap) {
|
||||||
II = ColFieldValueMap.begin(), IE = ColFieldValueMap.end();
|
std::vector<Init*> FieldValues = Entry.second;
|
||||||
II != IE; II++) {
|
|
||||||
std::vector<Init*> FieldValues = (*II).second;
|
|
||||||
|
|
||||||
// Delete duplicate entries from ColFieldValueMap
|
// Delete duplicate entries from ColFieldValueMap
|
||||||
for (unsigned i = 0; i < FieldValues.size() - 1; i++) {
|
for (unsigned i = 0; i < FieldValues.size() - 1; i++) {
|
||||||
@ -540,9 +537,9 @@ static void emitEnums(raw_ostream &OS, RecordKeeper &Records) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Emit enumerated values for the column fields.
|
// Emit enumerated values for the column fields.
|
||||||
OS << "enum " << (*II).first << " {\n";
|
OS << "enum " << Entry.first << " {\n";
|
||||||
for (unsigned i = 0, endFV = FieldValues.size(); i < endFV; i++) {
|
for (unsigned i = 0, endFV = FieldValues.size(); i < endFV; i++) {
|
||||||
OS << "\t" << (*II).first << "_" << FieldValues[i]->getAsUnquotedString();
|
OS << "\t" << Entry.first << "_" << FieldValues[i]->getAsUnquotedString();
|
||||||
if (i != endFV - 1)
|
if (i != endFV - 1)
|
||||||
OS << ",\n";
|
OS << ",\n";
|
||||||
else
|
else
|
||||||
@ -577,8 +574,8 @@ void EmitMapTable(RecordKeeper &Records, raw_ostream &OS) {
|
|||||||
// Iterate over all instruction mapping records and construct relationship
|
// Iterate over all instruction mapping records and construct relationship
|
||||||
// maps based on the information specified there.
|
// maps based on the information specified there.
|
||||||
//
|
//
|
||||||
for (unsigned i = 0, e = InstrMapVec.size(); i < e; i++) {
|
for (Record *CurMap : InstrMapVec) {
|
||||||
MapTableEmitter IMap(Target, Records, InstrMapVec[i]);
|
MapTableEmitter IMap(Target, Records, CurMap);
|
||||||
|
|
||||||
// Build RowInstrMap to group instructions based on their values for
|
// Build RowInstrMap to group instructions based on their values for
|
||||||
// RowFields. In the process, also collect key instructions into
|
// RowFields. In the process, also collect key instructions into
|
||||||
|
Loading…
x
Reference in New Issue
Block a user