to serve as the entry block. An empty entry block (just as with an
empty exit block, which we already have) simplifies building analyses on top
of CFGs with very little extra overhead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42031
91177308-0d34-0410-b5e6-
96231b3b80d8
}
// Create an empty entry block that has no predecessors.
- if (B->pred_size() > 0) {
- Succ = B;
- cfg->setEntry(createBlock());
- }
- else cfg->setEntry(B);
+ Succ = B;
+ cfg->setEntry(createBlock());
// NULL out cfg so that repeated calls to the builder will fail and that
// the ownership of the constructed CFG is passed to the caller.
cfg = NULL;
return t;
}
- else return NULL;
+ else {
+ assert (false && "CFG construction failed.");
+ return NULL;
+ }
}
/// createBlock - Used to lazily create blocks that are connected