Reduce size of register name index tables by using uint16_t for all in tree targets. If more than 16-bits are needed for any out of tree targets, code will detect and use uint32_t instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163878 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/SequenceToOffsetTable.h b/utils/TableGen/SequenceToOffsetTable.h
index 60202b5..a4f16ca 100644
--- a/utils/TableGen/SequenceToOffsetTable.h
+++ b/utils/TableGen/SequenceToOffsetTable.h
@@ -82,9 +82,9 @@
}
bool empty() const { return Seqs.empty(); }
-
+
/// layout - Computes the final table layout.
- void layout() {
+ unsigned layout() {
assert(Entries == 0 && "Can only call layout() once");
// Lay out the table in Seqs iteration order.
for (typename SeqMap::iterator I = Seqs.begin(), E = Seqs.end(); I != E;
@@ -93,6 +93,7 @@
// Include space for a terminator.
Entries += I->first.size() + 1;
}
+ return Entries;
}
/// get - Returns the offset of Seq in the final table.