summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-05-15 07:36:59 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-05-15 07:36:59 +0000
commit453f4f01302f00651aae2fc7658f6e23a2beadb0 (patch)
tree1454f10c61d8ed47d4f3e9f392f6c54366fca599 /tools/bugpoint
parent1fe14c56f11c76aa90f27da633380548a9ee71a5 (diff)
downloadllvm-453f4f01302f00651aae2fc7658f6e23a2beadb0.tar.gz
llvm-453f4f01302f00651aae2fc7658f6e23a2beadb0.tar.bz2
llvm-453f4f01302f00651aae2fc7658f6e23a2beadb0.tar.xz
Use only explicit bool conversion operators
BitVector/SmallBitVector::reference::operator bool remain implicit since they model more exactly a bool, rather than something else that can be boolean tested. The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. One behavior change (YAMLParser) was made, though no test case is included as I'm not sure how to reach that code path. Essentially any comparison of llvm::yaml::document_iterators would be invalid if neither iterator was at the end. This helped uncover a couple of bugs in Clang - test cases provided for those in a separate commit along with similar changes to `operator bool` instances in Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/Miscompilation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index c676a05cb6..11ac0de104 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -130,7 +130,7 @@ ReduceMiscompilingPasses::doTest(std::vector<std::string> &Prefix,
//
OwningPtr<Module> PrefixOutput(ParseInputFile(BitcodeResult,
BD.getContext()));
- if (PrefixOutput == 0) {
+ if (!PrefixOutput) {
errs() << BD.getToolName() << ": Error reading bitcode file '"
<< BitcodeResult << "'!\n";
exit(1);