diff options
-rw-r--r-- | utils/TableGen/AsmWriterEmitter.cpp | 7 | ||||
-rw-r--r-- | utils/TableGen/SequenceToOffsetTable.h | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index 8c49288..d0cd057 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -575,13 +575,12 @@ emitRegisterNameString(raw_ostream &O, StringRef AltName, StringTable.add(AsmName); } - unsigned Entries = StringTable.layout(); + StringTable.layout(); O << " static const char AsmStrs" << AltName << "[] = {\n"; StringTable.emit(O, printChar); O << " };\n\n"; - O << " static const uint" << ((Entries > 0xffff) ? "32" : "16") - << "_t RegAsmOffset" << AltName << "[] = {"; + O << " static const uint32_t RegAsmOffset" << AltName << "[] = {"; for (unsigned i = 0, e = Registers.size(); i != e; ++i) { if ((i % 14) == 0) O << "\n "; @@ -620,7 +619,7 @@ void AsmWriterEmitter::EmitGetRegisterName(raw_ostream &O) { emitRegisterNameString(O, "", Registers); if (hasAltNames) { - O << " const unsigned *RegAsmOffset;\n" + O << " const uint32_t *RegAsmOffset;\n" << " const char *AsmStrs;\n" << " switch(AltIdx) {\n" << " default: llvm_unreachable(\"Invalid register alt name index!\");\n"; diff --git a/utils/TableGen/SequenceToOffsetTable.h b/utils/TableGen/SequenceToOffsetTable.h index a4f16ca..d4db152 100644 --- a/utils/TableGen/SequenceToOffsetTable.h +++ b/utils/TableGen/SequenceToOffsetTable.h @@ -84,7 +84,7 @@ public: bool empty() const { return Seqs.empty(); } /// layout - Computes the final table layout. - unsigned layout() { + void 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,7 +93,6 @@ public: // Include space for a terminator. Entries += I->first.size() + 1; } - return Entries; } /// get - Returns the offset of Seq in the final table. |