diff options
author | Zachary Turner <zturner@google.com> | 2016-05-06 20:51:57 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-05-06 20:51:57 +0000 |
commit | 819e77d196f208cc8ef15b4186e07ecb14a115c8 (patch) | |
tree | 409e2ff42a99563c75759c4c22116c35eb60569c /llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp | |
parent | 091fcfa3a7632b6bbfbefdac84e0425d827d288c (diff) | |
download | bcm5719-llvm-819e77d196f208cc8ef15b4186e07ecb14a115c8.tar.gz bcm5719-llvm-819e77d196f208cc8ef15b4186e07ecb14a115c8.zip |
Port DebugInfoPDB over to using llvm::Error.
Differential Revision: http://reviews.llvm.org/D19940
Reviewed By: rnk
llvm-svn: 268791
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp b/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp index 18d29953e25..ed9c9d400af 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/StreamReader.cpp @@ -8,42 +8,43 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/PDB/Raw/StreamReader.h" +#include "llvm/DebugInfo/PDB/Raw/RawError.h" using namespace llvm; using namespace llvm::pdb; StreamReader::StreamReader(const StreamInterface &S) : Stream(S), Offset(0) {} -std::error_code StreamReader::readBytes(MutableArrayRef<uint8_t> Buffer) { +Error StreamReader::readBytes(MutableArrayRef<uint8_t> Buffer) { if (auto EC = Stream.readBytes(Offset, Buffer)) return EC; Offset += Buffer.size(); - return std::error_code(); + return Error::success(); } -std::error_code StreamReader::readInteger(uint32_t &Dest) { +Error StreamReader::readInteger(uint32_t &Dest) { support::ulittle32_t P; - if (std::error_code EC = readObject(&P)) + if (auto EC = readObject(&P)) return EC; Dest = P; - return std::error_code(); + return Error::success(); } -std::error_code StreamReader::readZeroString(std::string &Dest) { +Error StreamReader::readZeroString(std::string &Dest) { Dest.clear(); char C; do { - readObject(&C); + if (auto EC = readObject(&C)) + return EC; if (C != '\0') Dest.push_back(C); } while (C != '\0'); - return std::error_code(); + return Error::success(); } -std::error_code StreamReader::getArrayRef(ArrayRef<uint8_t> &Array, - uint32_t Length) { +Error StreamReader::getArrayRef(ArrayRef<uint8_t> &Array, uint32_t Length) { if (auto EC = Stream.getArrayRef(Offset, Array, Length)) return EC; Offset += Length; - return std::error_code(); + return Error::success(); } |