summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenMapTable.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-02-11 07:39:29 +0000
committerCraig Topper <craig.topper@gmail.com>2016-02-11 07:39:29 +0000
commit6e2edc4b84352c126eab02196c3002ab71381808 (patch)
treeeb0263df517ce8b08d08d917c0d2ed2b2abc096b /llvm/utils/TableGen/CodeGenMapTable.cpp
parenta3ebc4f03ee2315b9fc36cef48e16e4f37fc79ec (diff)
downloadbcm5719-llvm-6e2edc4b84352c126eab02196c3002ab71381808.tar.gz
bcm5719-llvm-6e2edc4b84352c126eab02196c3002ab71381808.zip
[TableGen] Use range-based for loops. NFC
llvm-svn: 260502
Diffstat (limited to 'llvm/utils/TableGen/CodeGenMapTable.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenMapTable.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/utils/TableGen/CodeGenMapTable.cpp b/llvm/utils/TableGen/CodeGenMapTable.cpp
index 76d0ae29faa..09ea705ae01 100644
--- a/llvm/utils/TableGen/CodeGenMapTable.cpp
+++ b/llvm/utils/TableGen/CodeGenMapTable.cpp
@@ -499,8 +499,7 @@ static void emitEnums(raw_ostream &OS, RecordKeeper &Records) {
// Iterate over all InstrMapping records and create a map between column
// fields and their possible values across all records.
- for (unsigned i = 0, e = InstrMapVec.size(); i < e; i++) {
- Record *CurMap = InstrMapVec[i];
+ for (Record *CurMap : InstrMapVec) {
ListInit *ColFields;
ColFields = CurMap->getValueAsListInit("ColFields");
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
- II = ColFieldValueMap.begin(), IE = ColFieldValueMap.end();
- II != IE; II++) {
- std::vector<Init*> FieldValues = (*II).second;
+ for (auto &Entry : ColFieldValueMap) {
+ std::vector<Init*> FieldValues = Entry.second;
// Delete duplicate entries from ColFieldValueMap
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.
- OS << "enum " << (*II).first << " {\n";
+ OS << "enum " << Entry.first << " {\n";
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)
OS << ",\n";
else
@@ -577,8 +574,8 @@ void EmitMapTable(RecordKeeper &Records, raw_ostream &OS) {
// Iterate over all instruction mapping records and construct relationship
// maps based on the information specified there.
//
- for (unsigned i = 0, e = InstrMapVec.size(); i < e; i++) {
- MapTableEmitter IMap(Target, Records, InstrMapVec[i]);
+ for (Record *CurMap : InstrMapVec) {
+ MapTableEmitter IMap(Target, Records, CurMap);
// Build RowInstrMap to group instructions based on their values for
// RowFields. In the process, also collect key instructions into
OpenPOWER on IntegriCloud