[llvm-commits] [llvm-gcc-4.2] r43909 - in /llvm-gcc-4.2/trunk/gcc: config/arm/arm.h llvm-convert.cpp

Lauro Ramos Venancio lauro.venancio at gmail.com
Sat Nov 10 12:10:23 PST 2007


>
> 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;


Lauro



More information about the llvm-commits mailing list