This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed-up get_identifier("main")


On Wednesday, August 6, 2003, at 03:19 PM, Jason Merrill wrote:
Could we use __builtin_constant_p to do this transformation transparently,
i.e.


#define get_identifier(STR) \
  __builtin_constant_p (STR) \
  ? get_identifier_with_length (STR, (unsigned) (STR)) \
  : (get_identifier) (STR)

?

I was thinking the same this. I like this version. It would need to be protected against old gcc compilers.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]