aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 349d40e..3011459 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -179,10 +179,8 @@ static Expected<std::string> readIdentificationBlock(BitstreamCursor &Stream) {
while (true) {
BitstreamEntry Entry;
- if (Expected<BitstreamEntry> Res = Stream.advance())
- Entry = Res.get();
- else
- return Res.takeError();
+ if (Error E = Stream.advance().moveInto(Entry))
+ return std::move(E);
switch (Entry.Kind) {
default:
@@ -226,10 +224,8 @@ static Expected<std::string> readIdentificationCode(BitstreamCursor &Stream) {
return "";
BitstreamEntry Entry;
- if (Expected<BitstreamEntry> Res = Stream.advance())
- Entry = std::move(Res.get());
- else
- return Res.takeError();
+ if (Error E = Stream.advance().moveInto(Entry))
+ return std::move(E);
switch (Entry.Kind) {
case BitstreamEntry::EndBlock:
@@ -305,10 +301,8 @@ static Expected<bool> hasObjCCategory(BitstreamCursor &Stream) {
// need to understand them all.
while (true) {
BitstreamEntry Entry;
- if (Expected<BitstreamEntry> Res = Stream.advance())
- Entry = std::move(Res.get());
- else
- return Res.takeError();
+ if (Error E = Stream.advance().moveInto(Entry))
+ return std::move(E);
switch (Entry.Kind) {
case BitstreamEntry::Error: