Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions. Fixes assertion failure reported in PR 8619.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119284 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index ef67d3b..b58e982 100644
--- a/lib/Analysis/CFG.cpp
+++ b/lib/Analysis/CFG.cpp
@@ -1204,7 +1204,8 @@
// want the first predecessor to the the block containing the expression
// for the case when the ternary expression evaluates to true.
AddSuccessor(Block, ConfluenceBlock);
- assert(ConfluenceBlock->pred_size() == 2);
+ // Note that there can possibly only be one predecessor if one of the
+ // subexpressions resulted in calling a noreturn function.
std::reverse(ConfluenceBlock->pred_begin(),
ConfluenceBlock->pred_end());
}