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? -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110904/3d011c1a/attachment.html>
Hi, It looks like quite a small diff to add SmallString support to cl - just subclass (or copy-paste) the template specialization for std::string. Perhaps you could have a go at adding the support yourself and sending a patch? Cheers, James From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Talin Sent: 05 September 2011 05:14 To: LLVM Developers Mailing List Subject: [LLVMdev] SmallString for CommandLine options? 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? -- -- Talin -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110905/678241e8/attachment.html>
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. -Chris
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 alsoappears to use a mix of std::vector and SmallVector. I haven't really looked at it that deeply.> -Chris > >-- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110906/5421f507/attachment.html>
Maybe Matching Threads
- [LLVMdev] SmallString for CommandLine options?
- [LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
- [LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
- [LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
- [LLVMdev] SmallString + raw_svector_ostream combination should be more efficient