[PATCH] D14558: [llvm-profdata] Add check for text profile formats and improve error reporting

Nathan Slingerland via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 13:19:24 PST 2015


slingn marked an inline comment as done.

================
Comment at: lib/ProfileData/SampleProfReader.cpp:257
@@ +256,3 @@
+bool SampleProfileReaderText::hasFormat(const MemoryBuffer &Buffer) {
+  // Verify that this really looks like plain ASCII text by checking a
+  // 'reasonable' number of characters (up to profile magic size).
----------------
dnovillo wrote:
> This generic check won't let us distinguish text formats for sample vs instrumented profiles.  I'd suggest actually trying to parse a single line here (factor it out of the text parser) rather than checking for ASCII characters.
Good point. The sample profile text format is structured enough to enable that. Instrumented profile text format not so much.


http://reviews.llvm.org/D14558





More information about the llvm-commits mailing list