[llvm-commits] [llvm] r164088 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Craig Topper
craig.topper at gmail.com
Mon Sep 17 18:41:50 PDT 2012
Author: ctopper
Date: Mon Sep 17 20:41:49 2012
New Revision: 164088
URL: http://llvm.org/viewvc/llvm-project?rev=164088&view=rev
Log:
Mark asm matcher conversion table as const.
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=164088&r1=164087&r2=164088&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Mon Sep 17 20:41:49 2012
@@ -1686,9 +1686,9 @@
<< " const SmallVectorImpl<MCParsedAsmOperand*"
<< "> &Operands) {\n"
<< " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
- << " uint8_t *Converter = ConversionTable[Kind];\n"
+ << " const uint8_t *Converter = ConversionTable[Kind];\n"
<< " Inst.setOpcode(Opcode);\n"
- << " for (uint8_t *p = Converter; *p; p+= 2) {\n"
+ << " for (const uint8_t *p = Converter; *p; p+= 2) {\n"
<< " switch (*p) {\n"
<< " default: llvm_unreachable(\"invalid conversion entry!\");\n"
<< " case CVT_Reg:\n"
@@ -1710,8 +1710,8 @@
<< " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
<< " NumMCOperands = 0;\n"
<< " unsigned MCOperandNum = 0;\n"
- << " uint8_t *Converter = ConversionTable[Kind];\n"
- << " for (uint8_t *p = Converter; *p; p+= 2) {\n"
+ << " const uint8_t *Converter = ConversionTable[Kind];\n"
+ << " for (const uint8_t *p = Converter; *p; p+= 2) {\n"
<< " if (*(p + 1) > OperandNum) continue;\n"
<< " switch (*p) {\n"
<< " default: llvm_unreachable(\"invalid conversion entry!\");\n"
@@ -1947,7 +1947,7 @@
OS << "} // end anonymous namespace\n\n";
// Output the conversion table.
- OS << "static uint8_t ConversionTable[CVT_NUM_SIGNATURES]["
+ OS << "static const uint8_t ConversionTable[CVT_NUM_SIGNATURES]["
<< MaxRowLength << "] = {\n";
for (unsigned Row = 0, ERow = ConversionTable.size(); Row != ERow; ++Row) {
More information about the llvm-commits
mailing list