[PATCH] D15540: [PGO] differentiate FE instrumentation and IR level instrumentation profiles

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 12:07:58 PST 2015


davidxl added inline comments.

================
Comment at: lib/ProfileData/InstrProfReader.cpp:117
@@ +116,3 @@
+  bool IsIRInstr = false;
+  while (!Line.is_at_end() &&
+         (Line->empty() || Line->startswith("#") || Line->startswith(":"))) {
----------------
xur wrote:
> davidxl wrote:
> > Why not skipping comments and empty lines first:
> > 
> >  // Skip empty lines and comments.
> >   while (!Line.is_at_end() && (Line->empty() || Line->startswith("#")))
> >     ++Line;
> > 
> > 
> current code allows multiple instances of ":" line and the mixing of comments in between (late ones overrides the earlier ones).
> if you think we should only allow one. We can simplify the code like you suggested.
We don't want that kind of flexibility for the header structure. I would even suggest making it more strict -- the header lines (if there are any) must start at the first line of the file -- but I won't insist on that.


http://reviews.llvm.org/D15540





More information about the llvm-commits mailing list