diff options
author | JOE1994 <joseph942010@gmail.com> | 2024-09-13 19:34:30 -0400 |
---|---|---|
committer | JOE1994 <joseph942010@gmail.com> | 2024-09-13 19:55:44 -0400 |
commit | 459a82e6890ff41e30d486f36c8c7ec22628bb7a (patch) | |
tree | 0e607c61c5a5105d3f6126546582a64dee5ca723 /llvm/unittests/ProfileData/MemProfTest.cpp | |
parent | c010b72e9b4e3b1ae7467eb86102fc43c338fe19 (diff) | |
download | llvm-459a82e6890ff41e30d486f36c8c7ec22628bb7a.zip llvm-459a82e6890ff41e30d486f36c8c7ec22628bb7a.tar.gz llvm-459a82e6890ff41e30d486f36c8c7ec22628bb7a.tar.bz2 |
[llvm][unittests] Don't call raw_string_ostream::flush() (NFC)
raw_string_ostream::flush() is essentially a no-op (also specified in docs).
Don't call it in tests that aren't meant to test 'raw_string_ostream' itself.
p.s. remove a few redundant calls to raw_string_ostream::str()
Diffstat (limited to 'llvm/unittests/ProfileData/MemProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/MemProfTest.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index 14623e18..b7a9170 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -255,7 +255,6 @@ TEST(MemProf, PortableWrapper) { std::string Buffer; llvm::raw_string_ostream OS(Buffer); WriteBlock.serialize(Schema, OS); - OS.flush(); PortableMemInfoBlock ReadBlock( Schema, reinterpret_cast<const unsigned char *>(Buffer.data())); @@ -296,7 +295,6 @@ TEST(MemProf, RecordSerializationRoundTripVersion0And1) { std::string Buffer; llvm::raw_string_ostream OS(Buffer); Record.serialize(Schema, OS, llvm::memprof::Version0); - OS.flush(); const IndexedMemProfRecord GotRecord = IndexedMemProfRecord::deserialize( Schema, reinterpret_cast<const unsigned char *>(Buffer.data()), @@ -326,7 +324,6 @@ TEST(MemProf, RecordSerializationRoundTripVerion2) { std::string Buffer; llvm::raw_string_ostream OS(Buffer); Record.serialize(Schema, OS, llvm::memprof::Version2); - OS.flush(); const IndexedMemProfRecord GotRecord = IndexedMemProfRecord::deserialize( Schema, reinterpret_cast<const unsigned char *>(Buffer.data()), @@ -378,7 +375,6 @@ TEST(MemProf, RecordSerializationRoundTripVersion2HotColdSchema) { std::string Buffer; llvm::raw_string_ostream OS(Buffer); Record.serialize(Schema, OS, llvm::memprof::Version2); - OS.flush(); const IndexedMemProfRecord GotRecord = IndexedMemProfRecord::deserialize( Schema, reinterpret_cast<const unsigned char *>(Buffer.data()), |