}
// Bias offset by one since we want 0 as a sentinel.
+ assert((Idx+1) <= 0xffff && "String offset too large to fit in table");
OpcodeInfo.push_back(Idx+1);
}
O << " };\n\n";
// Emit the string itself.
- O << " const char *AsmStrs = \n";
+ O << " const char *const AsmStrs = \n";
StringTable.EmitString(O);
O << ";\n\n";
}
}
- O << StringTable.GetOrAddStringOffset(AsmName);
+ unsigned Idx = StringTable.GetOrAddStringOffset(AsmName);
+ assert(Idx <= 0xffff && "String offset too large to fit in table");
+ O << Idx;
if (((i + 1) % 14) == 0)
O << ",\n ";
else
if ((i % 14) == 0)
O << "\n ";
- O << StringTable.GetOrAddStringOffset(AsmName) << ", ";
+ unsigned Idx = StringTable.GetOrAddStringOffset(AsmName);
+ assert(Idx <= 0xffff && "String offset too large to fit in table");
+ O << Idx << ", ";
}
O << "0\n"
<< " };\n"