On Nov 10, 2007, at 12:10 PM, Lauro Ramos Venancio wrote:

>>
>> Does it make sense to make this work?  It seems much better than
>> having to hack arm.h for every subtarget that doesn't use @ as a
>> comment character.
>>
>
> I'm afraid I didn't understand your point. I think the problem is
> - Target can have inline asm extensions (not only comments - ARM
> target has two extensions: '%@' and '%r').
> So we need a way to define this extensions. To do this, I copied the
> idea used by the gcc codegen.
>
> arm.h code for gcc codegen:
>
> /* These are a couple of extensions to the formats accepted
>    by asm_fprintf:
>      %@ prints out ASM_COMMENT_START
>      %r prints out REGISTER_PREFIX reg_names[arg]  */
> #define ASM_FPRINTF_EXTENSIONS(FILE, ARGS, P)         \
>   case '@':                                           \
>     fputs (ASM_COMMENT_START, FILE);                  \
>     break;                                            \
>                                                       \
>   case 'r':                                           \
>     fputs (REGISTER_PREFIX, FILE);                    \
>     fputs (reg_names [va_arg (ARGS, int)], FILE);     \
>     break;

Hi Lauro,

It seems like there is two options: when lowering from GCC asm to  
llvm asm, we can either change %@ (for example) into  
ASM_COMMENT_START.  Alternatively, we can lower it to "${:comment}",  
which llvm asm already expands out to the right thing.  Does this  
make sense?  The important point here is that not all arm targets use  
@ for their comment character, and we don't want to break that.

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to