Make the disassembler tables const so they end up in read-only memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117206 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp
index 8a32f4a..76ea320 100644
--- a/utils/TableGen/X86DisassemblerTables.cpp
+++ b/utils/TableGen/X86DisassemblerTables.cpp
@@ -275,7 +275,7 @@
return;
}
- o1.indent(i1) << "static InstrUID modRMTable" << thisTableNumber;
+ o1.indent(i1) << "static const InstrUID modRMTable" << thisTableNumber;
switch (dt) {
default:
@@ -365,7 +365,7 @@
uint32_t &i2,
ContextDecision &decision,
const char* name) const {
- o2.indent(i2) << "static struct ContextDecision " << name << " = {\n";
+ o2.indent(i2) << "static const struct ContextDecision " << name << " = {\n";
i2++;
o2.indent(i2) << "{ /* opcodeDecisions */" << "\n";
i2++;
@@ -392,9 +392,8 @@
void DisassemblerTables::emitInstructionInfo(raw_ostream &o, uint32_t &i)
const {
- o.indent(i * 2) << "static struct InstructionSpecifier " INSTRUCTIONS_STR "[";
- o << InstructionSpecifiers.size();
- o << "] = {" << "\n";
+ o.indent(i * 2) << "static const struct InstructionSpecifier ";
+ o << INSTRUCTIONS_STR "[" << InstructionSpecifiers.size() << "] = {\n";
i++;