forked from OSchip/llvm-project
Verifier: Remove dead code.
Remove previously unreachable code that verifies that a function definition has an entry block. By definition, a function definition has at least one block. llvm-svn: 271948
This commit is contained in:
parent
d7caf5889b
commit
71bb79430f
|
@ -276,13 +276,14 @@ public:
|
|||
Context = &M->getContext();
|
||||
|
||||
// First ensure the function is well-enough formed to compute dominance
|
||||
// information.
|
||||
if (F.empty()) {
|
||||
if (OS)
|
||||
*OS << "Function '" << F.getName()
|
||||
<< "' does not contain an entry block!\n";
|
||||
return false;
|
||||
}
|
||||
// information, and directly compute a dominance tree. We don't rely on the
|
||||
// pass manager to provide this as it isolates us from a potentially
|
||||
// out-of-date dominator tree and makes it significantly more complex to run
|
||||
// this code outside of a pass manager.
|
||||
// FIXME: It's really gross that we have to cast away constness here.
|
||||
if (!F.empty())
|
||||
DT.recalculate(const_cast<Function &>(F));
|
||||
|
||||
for (const BasicBlock &BB : F) {
|
||||
if (!BB.empty() && BB.back().isTerminator())
|
||||
continue;
|
||||
|
@ -296,13 +297,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
// Now directly compute a dominance tree. We don't rely on the pass
|
||||
// manager to provide this as it isolates us from a potentially
|
||||
// out-of-date dominator tree and makes it significantly more complex to
|
||||
// run this code outside of a pass manager.
|
||||
// FIXME: It's really gross that we have to cast away constness here.
|
||||
DT.recalculate(const_cast<Function &>(F));
|
||||
|
||||
Broken = false;
|
||||
// FIXME: We strip const here because the inst visitor strips const.
|
||||
visit(const_cast<Function &>(F));
|
||||
|
|
Loading…
Reference in New Issue