This patch adds the missing functionality in parsable text format support for value profiling.
Details
Diff Detail
Event Timeline
Sorry for the latency, comments inline --
lib/ProfileData/InstrProfReader.cpp | ||
---|---|---|
107 | I'd prefer to keep format changes for separate NFC commits. | |
127 | This looks correct but a bit repetitive. What do you think of using a macro like: #define AdvanceAndReadInt(Line, Dst) \ if ((Line).is_at_end()) \ return error(instrprof_error::truncated); \ if (((Line)++)->getAsInteger(10, (Dst))) return error(instrprof_error::truncated); \ You could move the various "uint32_t" definitions up, or define them within the macro. | |
211 | This could use a comment like "// Check if we have value profile data, and if so, read it.". | |
test/tools/llvm-profdata/Inputs/vp-malform.proftext | ||
5 | I don't think these input files should have RUN lines. | |
43 | It's not obvious that this is the error. Please add notes to your tests which make it clear what's being tested. | |
48 | Ditto for CHECK lines. | |
test/tools/llvm-profdata/Inputs/vp-malform2.proftext | ||
5 | Same comments from the last file. Could you trim this file down a bit? It seems very similar to the last one. | |
test/tools/llvm-profdata/Inputs/vp-truncate.proftext | ||
5 | Same note about the RUN lines. |
I'd prefer to keep format changes for separate NFC commits.