[cfe-commits] r138666 - /cfe/trunk/lib/Driver/Driver.cpp

David Blaikie dblaikie at gmail.com
Fri Aug 26 14:55:01 PDT 2011


>
>  // Strip the directory and suffix from BaseInput.
> -static const char *getBaseName (const char *BaseInput) {
> +static std::string getBaseName (const char *BaseInput) {
>   std::pair<StringRef, StringRef> Split = StringRef(BaseInput).rsplit('/');
>   if (Split.second != "")
> -    return Split.second.split('.').first.str().c_str();
> +    return Split.second.split('.').first.str();
>   else
> -    return Split.first.split('.').first.str().c_str();
> +    return Split.first.split('.').first.str();
>  }
>
>
Shouldn't this just return StringRef instead? what's the reason you're
converting to std::string at all here?

- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110826/79ea0dfc/attachment.html>


More information about the cfe-commits mailing list