1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/DebugInfo
Pavel Labath d0775d3cfb Add error handling to the DataExtractor class
Summary:
This is motivated by D63591, where we realized that there isn't a really
good way of telling whether a DataExtractor is reading actual data, or
is it just returning default values because it reached the end of the
buffer.

This patch resolves that by providing a new "Cursor" class. A Cursor
object encapsulates two things:
- the current position/offset in the DataExtractor
- an error object

Storing the error object inside the Cursor enables one to use the same
pattern as the std::{io}stream API, where one can blindly perform a
sequence of reads and only check for errors once at the end of the
operation. Similarly to the stream API, as soon as we encounter one
error, all of the subsequent operations are skipped (return default
values) too, even if the would suceed with clear error state. Unlike the
std::stream API (but in line with other llvm APIs), we force the error
state to be checked through usage of llvm::Error.

Reviewers: probinson, dblaikie, JDevlieghere, aprantl, echristo

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63713

llvm-svn: 370042
2019-08-27 11:24:08 +00:00
..
CodeView Removing block comments from CodeView records in assembly files & related code cleanup 2019-08-25 01:09:11 +00:00
DWARF Add error handling to the DataExtractor class 2019-08-27 11:24:08 +00:00
GSYM Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges 2019-08-21 21:48:11 +00:00
MSF [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
PDB [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Symbolize [llvm-objdump] Add warning messages if disassembly + source for problematic inputs 2019-08-15 05:15:22 +00:00
CMakeLists.txt Add GSYM utility files along with unit tests. 2019-06-26 14:09:09 +00:00
LLVMBuild.txt Fix build in shared lib mode. 2019-06-26 15:46:48 +00:00