[llvm-commits] [llvm] r169393 - in /llvm/trunk: include/llvm-c/Disassembler.h include/llvm/MC/MCInstPrinter.h lib/MC/MCDisassembler/Disassembler.cpp lib/MC/MCInstPrinter.cpp lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp test/MC/Disassembler/ARM/hex-immediates.txt test/MC/Disassembler/X86/hex-immediates.txt tools/llvm-mc/llvm-mc.cpp

Kevin Enderby enderby at apple.com
Thu Dec 6 17:13:13 PST 2012


On Dec 6, 2012, at 4:59 PM, Chris Lattner wrote:

> 
> On Dec 5, 2012, at 10:13 AM, Kevin Enderby <enderby at apple.com> wrote:
> 
>> Author: enderby
>> Date: Wed Dec  5 12:13:19 2012
>> New Revision: 169393
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=169393&view=rev
>> Log:
>> Added a option to the disassembler to print immediates as hex.
>> 
>> This is for the lldb team so most of but not all of the values are
>> to be printed as hex with this option.  Some small values like the
>> scale in an X86 address were requested to printed in decimal
>> without the leading 0x.
>> 
>> There may be some tweaks need to places that may still be in
>> decimal that they want in hex.  Specially for arm.  I made my best
>> guess.  Any tweaks from here should be simple.
> 
> 
> Cool, would it make sense to print all numbers from 0-9 without the 0x prefix?

It could!  I'd like the lldb guys to drive this as the radar bug was talking about parsing the output in some cases.  And maybe they want to see the leading 0x for the immediates they feel are interesting?  Either way it should it would be very easy to tweak things now that this change is in.

If I were to put on my otool(1) hat, what I would like to see is to not only pass the value but the number of bytes that value had in the instruction.  As I want to see 0x01, 0x0001, 0x00000001 and 0x0000000000000001 for 1, 2, 4 and 8 byte immediates.

> 
> -Chris
> 




More information about the llvm-commits mailing list