https://bugs.llvm.org/show_bug.cgi?id=46629
Bug ID: 46629
Summary: Syntax warning in TableGen'd XXGenMCCodeEmitter.inc
calling APInt LoadIntFromMemory utility function
Product: tools
Version: 10.0
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: TableGen
Assignee: unassignedb...@nondot.org
Reporter: chris.se...@gmail.com
CC: llvm-bugs@lists.llvm.org
TableGen supports large instructions, in my case, bits<128> Inst; This makes
TableGen generate APInt Insts rather than uint64_t or smaller. This is rarely
exercised code and so when I include the generated XXGenMCCodeEmitter.inc file,
I get a warning:
warning: cast from 'const unsigned long long *' to 'unsigned char *' drops
const qualifier [-Wcast-qual]
LoadIntFromMemory(Inst, (uint8_t*)&InstBits[opcode * 2], 16);
It's complaining because InstBits is declared as
static const uint64_t InstBits[]
whereas LoadIntFromMemory()'s second argument is declared as
uint8_t *Src
Removing the const from InstBits does make the error message go away but it
seems to me that adding const to the LoadIntFromMemory Src argument is the
better solution. However, that may cause more warnings.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs