[Support] Add reserve() method to the raw_ostream.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Mon, 8 Feb 2021 15:11:39 +0000 (18:11 +0300)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Tue, 23 Feb 2021 11:06:38 +0000 (14:06 +0300)
commit875b3b2cdda105c01af9a1330b1cb6a3f1e1b822
treef75150952c2c6534616beb1245adbffe88fcf694
parentbda83ba0d296303dff02d262cab73dc984cda3c1
[Support] Add reserve() method to the raw_ostream.

If resulting size of the output stream is already known,
then the space for stream data could be preliminary
allocated in some cases. f.e. raw_string_ostream could
preallocate the space for the target string(it allows
to avoid reallocations during writing into the stream).

Differential Revision: https://reviews.llvm.org/D91693
llvm/include/llvm/Support/raw_ostream.h
llvm/unittests/Support/raw_ostream_test.cpp