diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-10-23 09:10:44 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-10-23 09:10:44 +0000 |
commit | 4d1dca92bd6d4aad7121e28c7ffc93c0a6a187d7 (patch) | |
tree | 538dd2537e342b097cd3f77fe14ab3ad6fa47679 /utils/TableGen/X86DisassemblerTables.cpp | |
parent | c527407010fadcbca0bc394ada311f2122df2bc0 (diff) | |
download | external_llvm-4d1dca92bd6d4aad7121e28c7ffc93c0a6a187d7.zip external_llvm-4d1dca92bd6d4aad7121e28c7ffc93c0a6a187d7.tar.gz external_llvm-4d1dca92bd6d4aad7121e28c7ffc93c0a6a187d7.tar.bz2 |
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
Diffstat (limited to 'utils/TableGen/X86DisassemblerTables.cpp')
-rw-r--r-- | utils/TableGen/X86DisassemblerTables.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, return; } - o1.indent(i1) << "static InstrUID modRMTable" << thisTableNumber; + o1.indent(i1) << "static const InstrUID modRMTable" << thisTableNumber; switch (dt) { default: @@ -365,7 +365,7 @@ void DisassemblerTables::emitContextDecision( 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::emitContextDecision( 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++; |