[instrprof] Add an overload to accept raw_string_ostream.
authorSnehasish Kumar <snehasishk@google.com>
Tue, 27 Jun 2023 18:26:57 +0000 (18:26 +0000)
committerSnehasish Kumar <snehasishk@google.com>
Wed, 28 Jun 2023 16:37:15 +0000 (16:37 +0000)
commit4aabd19c06d353c319d8bbc598305cd254b6b8b8
treeb9760b12f57c1f022f74355839cb11072e71d7a2
parente165bc263132d3445f69a31e95a7b82336ec7a1b
[instrprof] Add an overload to accept raw_string_ostream.

Add an overload for InstrProfWriter::write so that users can emit the
buffer to a string. Also use this new overload for existing unit test
usecases.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D153904
llvm/include/llvm/ProfileData/InstrProfWriter.h
llvm/lib/ProfileData/InstrProfWriter.cpp