[cfe-dev] What is the StringRef equivalent of NULL?
Peter Davies
ultratwo at gmail.com
Tue Aug 17 12:11:30 PDT 2010
> Because that constructor is specified to take a non-null pointer :). It is a hot method and doing the null check would be wasteful.
>
> -Chris
In the vast majority of cases (static argument), that cost will be
eliminated by a decent optimizer. This makes converting functions that
accept NULL in their const char * args hard to convert. Ultimately
though, it's your choice.
Peter
More information about the cfe-dev
mailing list