[PATCH] D14558: [llvm-profdata] Add check for text profile formats and improve error reporting
Diego Novillo via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 07:09:58 PST 2015
dnovillo added a comment.
Could you add a test for the new behaviour that you described in the patch?
Thanks.
================
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).
----------------
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.
http://reviews.llvm.org/D14558
More information about the llvm-commits
mailing list