git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163878
91177308-0d34-0410-b5e6-
96231b3b80d8
StringTable.add(AsmName);
}
- StringTable.layout();
+ unsigned Entries = StringTable.layout();
O << " static const char AsmStrs" << AltName << "[] = {\n";
StringTable.emit(O, printChar);
O << " };\n\n";
- O << " static const unsigned RegAsmOffset" << AltName << "[] = {";
+ O << " static const uint" << ((Entries > 0xffff) ? "32" : "16")
+ << "_t RegAsmOffset" << AltName << "[] = {";
for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
if ((i % 14) == 0)
O << "\n ";
}
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;
// Include space for a terminator.
Entries += I->first.size() + 1;
}
+ return Entries;
}
/// get - Returns the offset of Seq in the final table.