Revert r163878 as it breaks on targets with alternate register names. Such targets...
authorCraig Topper <craig.topper@gmail.com>
Sat, 15 Sep 2012 01:22:42 +0000 (01:22 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sat, 15 Sep 2012 01:22:42 +0000 (01:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163959 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/AsmWriterEmitter.cpp
utils/TableGen/SequenceToOffsetTable.h

index 8c492887c8c89858dac1c63c374fb5b00d185f08..d0cd057cd3437f1f7d7b61306445536f9a6ae541 100644 (file)
@@ -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";
index a4f16ca9a6a2ec3ecb6a6e4d97f84366bcd5a763..d4db152a9681d4a84780ec9fdfbab17ecbc3d41e 100644 (file)
@@ -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.