Use uint16_t to store indices into string table since C++ only allows 64K string literals so the index into the big string can never be larger than that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152105 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index c4812dc..59926a3 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -463,7 +463,7 @@
 emitRegisterNameString(raw_ostream &O, StringRef AltName,
   const std::vector<CodeGenRegister*> &Registers) {
   StringToOffsetTable StringTable;
-  O << "  static const unsigned RegAsmOffset" << AltName << "[] = {\n    ";
+  O << "  static const uint16_t RegAsmOffset" << AltName << "[] = {\n    ";
   for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
     const CodeGenRegister &Reg = *Registers[i];
 
@@ -507,7 +507,7 @@
     << "  };\n"
     << "\n";
 
-  O << "  const char *AsmStrs" << AltName << " =\n";
+  O << "  const char *const AsmStrs" << AltName << " =\n";
   StringTable.EmitString(O);
   O << ";\n";
 }
@@ -541,7 +541,7 @@
     emitRegisterNameString(O, "", Registers);
 
   if (hasAltNames) {
-    O << "  const unsigned *RegAsmOffset;\n"
+    O << "  const uint16_t *RegAsmOffset;\n"
       << "  const char *AsmStrs;\n"
       << "  switch(AltIdx) {\n"
       << "  default: llvm_unreachable(\"Invalid register alt name index!\");\n";
@@ -583,7 +583,7 @@
   << "  assert(Opcode < " << NumberedInstructions.size()
   << " && \"Invalid instruction number!\");\n"
   << "\n"
-  << "  static const unsigned InstAsmOffset[] = {";
+  << "  static const uint16_t InstAsmOffset[] = {";
   for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
     const CodeGenInstruction &Inst = *NumberedInstructions[i];
 
@@ -597,7 +597,7 @@
   << "  };\n"
   << "\n";
 
-  O << "  const char *Strs =\n";
+  O << "  const char *const Strs =\n";
   StringTable.EmitString(O);
   O << ";\n";