diff options
| author | Pavel Labath <pavel@labath.sk> | 2019-08-29 14:26:05 +0000 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2019-08-29 14:26:05 +0000 |
| commit | bd546e59026d90b3a9f48f90586779de1f8c7202 (patch) | |
| tree | a5ffae2033dc2cdeaba15a9d08b3a8319ba670f4 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
| parent | e1f73e92d4cc0e38ef2e8b2a09fac85bf6919885 (diff) | |
| download | bcm5719-llvm-bd546e59026d90b3a9f48f90586779de1f8c7202.tar.gz bcm5719-llvm-bd546e59026d90b3a9f48f90586779de1f8c7202.zip | |
DWARFDebugLoc: Make parsing and error reporting more robust
Summary:
While examining this class for possible use in lldb, I noticed two
things:
- it spits out parsing errors directly to stderr
- the loclists parser can incorrectly return valid location lists when
parsing malformed (truncated) data
I improve the stderr situation by making the parseOneLocationList
functions return Expected<T>s. The errors are still dumped to stderr by
their callers, so this is only a partial fix, but it is enough for my
use case, as I intend to parse the locations lists one by one.
I fix the behavior in the truncated scenario by using the newly
introduced DataExtractor Cursor API.
I also add tests for handling the error cases, as they currently have no
coverage.
Reviewers: dblaikie, JDevlieghere, probinson
Subscribers: lldb-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63591
llvm-svn: 370363
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
0 files changed, 0 insertions, 0 deletions

