[PATCH] MC: Use StringRef to avoid strcmp/strlen on non-null-term'd strings.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Oct 13 10:05:26 PDT 2013


> Note that the use of ".data()" is okay when printing the
> lists of recognized -mcpu options and similar code, since
> the tables themselves are statically populated with C-strings
> that are guaranteed to be null-terminated.

I would probably avoid this by just splitting the format and passing
the stringref to errs() directly.

LGTM with that.

Cheers,
Rafael



More information about the llvm-commits mailing list