<Alexander G. Riccio> via llvm-dev
2016-Apr-13 03:18 UTC
[llvm-dev] llvm::opt::ArgStringList const char* vs llvm::StringRef
I noticed that ArgStringList - a very widely used type - uses raw const char* to hold strings, instead of wonderfully useful StringRef helper. Is there a technical reason for this? Does ArgStringList predate StringRef? Is it just that ArgStringList is too widely used to make any kind of breaking change? Sincerely, Alexander Riccio -- "Change the world or go home." about.me/ariccio <http://about.me/ariccio> If left to my own devices, I will build more. ⁂ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160412/8fcbc004/attachment.html>
Duncan P. N. Exon Smith via llvm-dev
2016-Apr-13 16:42 UTC
[llvm-dev] llvm::opt::ArgStringList const char* vs llvm::StringRef
From the class comment, it looks like ArgStringList is designed for building "argv" lists for invoking subprocesses. Thinks like ::exec and ::posix_spawn take a `const char *argv[]` parameter. Building an array of `StringRef` wouldn't actually solve the problem at hand.> On 2016-Apr-12, at 20:18, <Alexander G. Riccio> via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I noticed that ArgStringList - a very widely used type - uses raw const char* to hold strings, instead of wonderfully useful StringRef helper. Is there a technical reason for this? Does ArgStringList predate StringRef? Is it just that ArgStringList is too widely used to make any kind of breaking change? > > > Sincerely, > Alexander Riccio > -- > "Change the world or go home." > about.me/ariccio > > If left to my own devices, I will build more. > ⁂ > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev