[LLVMdev] SmallString for CommandLine options?
viridia at gmail.com
Tue Sep 6 21:52:26 CDT 2011
On Tue, Sep 6, 2011 at 3:57 PM, Chris Lattner <clattner at apple.com> wrote:
> On Sep 4, 2011, at 9:14 PM, Talin wrote:
> > I've managed to eliminate nearly all uses of std::string from my
> frontend. About the only ones remaining are all of the occurrences of
> cl::opt<std::string>. Is it likely that at some point we'll see support for
> SmallString in the command-line lib?
> The better fix is to switch cl::opt to allow StringRef: there is no
> specific reason to copy strings out of argv. The only thing to watch out for
> is the "parsecommandlineoptions" API, which doesn't necessarily own the
> underlying string pointers.
> It looks like it uses StringRef already internally. Although it also
appears to use a mix of std::vector and SmallVector. I haven't really looked
at it that deeply.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LLVMdev