[PATCH] D58580: [Support] llvm::to_string(): raw_string_ostream is a memory hog

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 10:54:36 PST 2019


rnk added a comment.

In D58580#1409433 <https://reviews.llvm.org/D58580#1409433>, @zturner wrote:

> I don't think we should discourage its use.  It turns out to be extremely useful.  But we also can't put it in STLExtras.h I think, because it would create a circular dependency.  Same goes for StringExtras.h.  We could either put it in raw_ostream.h or make a new file called StringConvert.h


I think for basic integers, if you want std::strings, you can use std::to_string. But, if you have something with an interesting operator<< overload (llvm/Format.h), then you need llvm::to_string or something like it. What about putting it in Format.h, since based on the other use sites that is the most common?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58580/new/

https://reviews.llvm.org/D58580





More information about the llvm-commits mailing list