diff options
| author | Frederic Riss <friss@apple.com> | 2014-09-18 09:38:15 +0000 |
|---|---|---|
| committer | Frederic Riss <friss@apple.com> | 2014-09-18 09:38:15 +0000 |
| commit | 076801a53be1664a7f803bb0aa5355e8ffae4b6a (patch) | |
| tree | 46ec544be2fd379f79138e85a5be5621ab01a9e5 /llvm/tools/llvm-diff/DiffConsumer.cpp | |
| parent | 87d2ca57d7d8b70de368e69eeb9a4cfdcb7f3e2a (diff) | |
| download | bcm5719-llvm-076801a53be1664a7f803bb0aa5355e8ffae4b6a.tar.gz bcm5719-llvm-076801a53be1664a7f803bb0aa5355e8ffae4b6a.zip | |
Fix DWARFUnitSection::getUnitForOffset().
The current code is only able to return the right unit if the passed offset
is the exact offset of a section. Generalize the search function by comparing
againt the offset of the next unit instead and by switching the search
algorithm to upper_bound.
This way, the unit returned is the first unit with a getNextUnitOffset()
strictly greater than the searched offset, which is exactly what we want.
Note that there is no need for testing the range of the resulting unit as
the offsets of a DWARFUnitSection are in a single contiguous range from
0 inclusive to lastUnit->getNextUnitOffset() exclusive.
Reviewers: dblaikie samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5262
llvm-svn: 218040
Diffstat (limited to 'llvm/tools/llvm-diff/DiffConsumer.cpp')
0 files changed, 0 insertions, 0 deletions

