[LLVMdev] SmallString for CommandLine options?

Chris Lattner clattner at apple.com
Tue Sep 6 15:57:09 PDT 2011


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




More information about the llvm-dev mailing list