[LLVMdev] Are Opcode and register mappings exposed anywhere?

Tyler Hardin
Mon, 28 Oct 2013 18:02:06 -0000

See the source here:
https://github.com/earl/llvm-mirror/blob/master/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp.
It looks like getRegisterName might do what you want, but I don't know
where it's coming from. (Whether it's a function or a member of a super
class. Hopefully, if it's a member, it's public.)

PS Sorry for the duplicate, Stephen. I forgot to CC the list.
On Oct 28, 2013 12:03 PM, "Stephen Checkoway" <s at pahtak.org>
wrote:

> 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
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20131028/b3011057/attachment.html>