Skip to content

Commit 594d0c3

Browse files
committed
[TableGen] Fix warning when compiling generated MCCodeEmitter
This fixes an instance of: warning: cast from 'const unsigned long *' to 'unsigned char *' drops const qualifier [-Wcast-qual] when compiling the generated MCCodeEmitter for an out-of-tree target that uses the optional support for instruction widths > 64 bits. Differential Revision: https://reviews.llvm.org/D97942
1 parent 9fc2be6 commit 594d0c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/CodeEmitterGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ void CodeEmitterGen::run(raw_ostream &o) {
481481
<< " Inst = Inst.zext(" << BitWidth << ");\n"
482482
<< " if (Scratch.getBitWidth() != " << BitWidth << ")\n"
483483
<< " Scratch = Scratch.zext(" << BitWidth << ");\n"
484-
<< " LoadIntFromMemory(Inst, (uint8_t *)&InstBits[opcode * " << NumWords
485-
<< "], " << NumBytes << ");\n"
484+
<< " LoadIntFromMemory(Inst, (const uint8_t *)&InstBits[opcode * "
485+
<< NumWords << "], " << NumBytes << ");\n"
486486
<< " APInt &Value = Inst;\n"
487487
<< " APInt &op = Scratch;\n"
488488
<< " switch (opcode) {\n";

0 commit comments

Comments
 (0)