[LLVMdev] Are Opcode and register mappings exposed anywhere?

Stephen Checkoway
Mon, 28 Oct 2013 16:00:26 -0000

I'm iterating over MCInsts and I'd like to examine particular
instructions. For example, I'd like to look at all x86 CALL64m instructions.
I may be missing something, but it seems like my only option is to use
MCInstPrinter::getOpcodeName and compare strings. (Of course, I could iterate
through the opcodes and build up a table of the ones I'm interested in to
avoid string comparisons.)

Register mappings to names seem to be even worse. It appears you have to go
through MCInstPrinter::printRegName(raw_ostream&, unsigned).

Is there a better way?

--
Stephen Checkoway