[llvm-commits] [llvm] r77499 - /llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp

Chris Lattner clattner at apple.com
Fri Jul 31 12:52:30 PDT 2009


On Jul 31, 2009, at 11:54 AM, David Greene wrote:

> On Friday 31 July 2009 10:35, Chris Lattner wrote:
>
>>>> Yep, that sounds like hte right thing to me.  If verbose-asm is  
>>>> off,
>>>> outputting \t as a space or a literal \t makes sense!
>>>
>>> Ok, I'll get on it.
>>
>> Many thanks David!
>
> Hrm.  What about this:
>
>        .byte   0x66; leaq      foo at TLSGD(%rip), %rdi; .word     
> 0x6666; rex64;
> call     __tls_get_addr at PLT
>
> which is now output as this:
>
>        .byte   0x66; leaq foo at TLSGD(%rip), %rdi; .word 0x6666;  
> rex64; call
> __tls_get_addr at PLT
>
> and four tests fail because they expect to see a tab between "leaq"  
> and "foo?"
>
> I wrote a special case in the patch to retain the tab after the  
> mnemonic
> (before operand 1) but it doesn't catch this (and other) cases  
> because the
> multiple instructions actually are considered many "operands" of the  
> ".byte"
> by AsmWriter.
>
> Is it ok if I just change the tests to look for a space instead?

Yep, changing the tests is perfectly fine.  FWIW, FileCheck defaults  
to ignoring differences in whitespace, so maybe it would be a good  
time to just convert them to FileCheck style.

> This is kind of an ugly way to output a mix of data and  
> instructions.  I
> wonder if we can invent a better way to support this in the future.

This specific one must be emitted that way exactly because of the way  
TLS relocations work on ELF.  Yes, it's a gross hack, but I don't  
think there is a much better way to do it.  The actual formatting of  
the instructions emitted doesn't matter of course, they could be  
emitted onto multiple lines etc if desired.

-Chris



More information about the llvm-commits mailing list