aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-11-11 04:29:25 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-11-11 04:29:25 +0000
commitc1edf566b9ba18806c9a69e77db1cc8e57a14c8d (patch)
treeea1b174a6e594d2b6929f9e4845cc2ba3d9d6f93 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent41af43092ccc8030bb49cea324d85eecd5ae68a8 (diff)
downloadllvm-c1edf566b9ba18806c9a69e77db1cc8e57a14c8d.zip
llvm-c1edf566b9ba18806c9a69e77db1cc8e57a14c8d.tar.gz
llvm-c1edf566b9ba18806c9a69e77db1cc8e57a14c8d.tar.bz2
Prevent at compile time converting from Error::success() to Expected<T>
This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index d2c2ec7..270a1c4 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -4330,7 +4330,7 @@ Expected<std::string> BitcodeReader::parseTriple() {
case BitstreamEntry::Error:
return error("Malformed block");
case BitstreamEntry::EndBlock:
- return Error::success();
+ return "";
case BitstreamEntry::SubBlock:
if (Entry.ID == bitc::MODULE_BLOCK_ID)
@@ -4363,14 +4363,14 @@ Expected<std::string> BitcodeReader::parseIdentificationBlock() {
// we need to make sure we aren't at the end of the stream before calling
// advance, otherwise we'll get an error.
if (Stream.AtEndOfStream())
- return Error::success();
+ return "";
BitstreamEntry Entry = Stream.advance();
switch (Entry.Kind) {
case BitstreamEntry::Error:
return error("Malformed block");
case BitstreamEntry::EndBlock:
- return Error::success();
+ return "";
case BitstreamEntry::SubBlock:
if (Entry.ID == bitc::IDENTIFICATION_BLOCK_ID) {
@@ -4421,7 +4421,7 @@ Expected<bool> BitcodeReader::hasObjCCategory() {
case BitstreamEntry::Error:
return error("Malformed block");
case BitstreamEntry::EndBlock:
- return Error::success();
+ return false;
case BitstreamEntry::SubBlock:
if (Entry.ID == bitc::MODULE_BLOCK_ID)