]> granicus.if.org Git - llvm/commit
LTOModule::isBitcodeFile() shouldn't assert when returning false.
authorNico Weber <nicolasweber@gmx.de>
Tue, 31 Oct 2017 16:39:47 +0000 (16:39 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 31 Oct 2017 16:39:47 +0000 (16:39 +0000)
commit003140e23d7cdb944b398577dbb454990fcd5fa4
tree2cb403e068eadbda8ee2323fbcd075c35cd160a2
parent7166565e5478bbaf3cbc9a48f68d939adc0ab4d4
LTOModule::isBitcodeFile() shouldn't assert when returning false.

Fixes a bunch of assert-on-invalid-bitcode regressions after 315483.
Expected<> calls assertIsChecked() in its dtor, and operator bool() only calls
setChecked() if there's no error. So for functions that don't return an error
itself, the Expected<> version needs explicit code to disarm the error that the
ErrorOr<> code didn't need.

https://reviews.llvm.org/D39437

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317010 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/LTOModule.cpp
test/tools/lto/no-bitcode.s [new file with mode: 0644]