summaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-05 17:16:08 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-05 17:16:08 +0000
commite05744ba850dd6c9aa438f6e2f60c77df8fcce74 (patch)
tree9df715ec73416caa4b629418786879562faa01bb /lib/Bitcode
parentf23af8bfd8609b9594947876209c3f0de070ea4f (diff)
downloadexternal_llvm-e05744ba850dd6c9aa438f6e2f60c77df8fcce74.zip
external_llvm-e05744ba850dd6c9aa438f6e2f60c77df8fcce74.tar.gz
external_llvm-e05744ba850dd6c9aa438f6e2f60c77df8fcce74.tar.bz2
Convert FindFunctionInStream to return an error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp9
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index f2039d4..3dd8f0b 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3049,17 +3049,18 @@ OutOfRecordLoop:
return error_code::success();
}
-/// FindFunctionInStream - Find the function body in the bitcode stream
-bool BitcodeReader::FindFunctionInStream(Function *F,
+/// Find the function body in the bitcode stream
+error_code BitcodeReader::FindFunctionInStream(Function *F,
DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator) {
while (DeferredFunctionInfoIterator->second == 0) {
if (Stream.AtEndOfStream())
return Error(CouldNotFindFunctionInStream);
// ParseModule will parse the next body in the stream and set its
// position in the DeferredFunctionInfo map.
- if (ParseModule(true)) return true;
+ if (error_code EC = ParseModule(true))
+ return EC;
}
- return false;
+ return error_code::success();
}
//===----------------------------------------------------------------------===//
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index 0a8bb01..b03658b 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/Reader/BitcodeReader.h
@@ -366,7 +366,7 @@ private:
error_code InitStream();
error_code InitStreamFromBuffer();
error_code InitLazyStream();
- bool FindFunctionInStream(Function *F,
+ error_code FindFunctionInStream(Function *F,
DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator);
};