aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
diff options
context:
space:
mode:
authorWalter Erquinigo <wallace@fb.com>2022-06-24 11:19:09 -0700
committerWalter Erquinigo <wallace@fb.com>2022-06-28 16:50:12 -0700
commitf91d82816ff5a88a59e86b54a4d63547776d4854 (patch)
tree2b48f107028e33e60a9c76a6bab93998ff1dc525 /llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
parent21895c6b5060d71aa4bbe619cfc3baeb1df1894b (diff)
downloadllvm-f91d82816ff5a88a59e86b54a4d63547776d4854.zip
llvm-f91d82816ff5a88a59e86b54a4d63547776d4854.tar.gz
llvm-f91d82816ff5a88a59e86b54a4d63547776d4854.tar.bz2
[trace] Improve the TraceCursor iteration API
The current way ot traversing the cursor is a bit uncommon and it can't handle empty traces, in fact, its invariant is that it shold always point to a valid item. This diff simplifies the cursor API and allows it to point to invalid items, thus being able to handle empty traces or to know it ran out of data. - Removed all the granularity functionalities, because we are not actually making use of that. We can bring them back when they are actually needed. - change the looping logic to the following: ``` for (; cursor->HasValue(); cursor->Next()) { if (cursor->IsError()) { .. do something for error continue; } .. do something for instruction } ``` - added a HasValue method that can be used to identify if the cursor ran out of data, the trace is empty, or the user tried to move to an invalid position via SetId() or Seek() - made several simplifications to severals parts of the code. Differential Revision: https://reviews.llvm.org/D128543
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp')
0 files changed, 0 insertions, 0 deletions