[PATCH] D15211: [ProfileData] Add unit test infrastructure for sample profile reader/writer

Nathan Slingerland via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 14:29:53 PST 2015


slingn added inline comments.

================
Comment at: include/llvm/ProfileData/SampleProfWriter.h:32
@@ -31,3 +31,3 @@
 public:
   SampleProfileWriter(StringRef Filename, std::error_code &EC,
                       sys::fs::OpenFlags Flags)
----------------
davidxl wrote:
> Is this constructor redundant now?
Yes - we should be able to just use the stream interface.

================
Comment at: unittests/ProfileData/SampleProfTest.cpp:31
@@ +30,3 @@
+  std::string Data;
+  std::unique_ptr<raw_ostream> OS;
+  std::unique_ptr<SampleProfileWriter> Writer;
----------------
silvas wrote:
> Can you just hold this by value?
Yes...that implies that SampleProfileWriter::create() should take a raw_ostream & rather than unique_ptr<raw_ostream> in that case. And that means that a caller of SampleProfileWriter::create() owns the output stream rather than the writer.


http://reviews.llvm.org/D15211





More information about the llvm-commits mailing list