mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
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
39d503a5a9
commit
77f644cc10
@ -276,13 +276,14 @@ public:
|
|||||||
Context = &M->getContext();
|
Context = &M->getContext();
|
||||||
|
|
||||||
// First ensure the function is well-enough formed to compute dominance
|
// First ensure the function is well-enough formed to compute dominance
|
||||||
// information.
|
// information, and directly compute a dominance tree. We don't rely on the
|
||||||
if (F.empty()) {
|
// pass manager to provide this as it isolates us from a potentially
|
||||||
if (OS)
|
// out-of-date dominator tree and makes it significantly more complex to run
|
||||||
*OS << "Function '" << F.getName()
|
// this code outside of a pass manager.
|
||||||
<< "' does not contain an entry block!\n";
|
// FIXME: It's really gross that we have to cast away constness here.
|
||||||
return false;
|
if (!F.empty())
|
||||||
}
|
DT.recalculate(const_cast<Function &>(F));
|
||||||
|
|
||||||
for (const BasicBlock &BB : F) {
|
for (const BasicBlock &BB : F) {
|
||||||
if (!BB.empty() && BB.back().isTerminator())
|
if (!BB.empty() && BB.back().isTerminator())
|
||||||
continue;
|
continue;
|
||||||
@ -296,13 +297,6 @@ public:
|
|||||||
return false;
|
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;
|
Broken = false;
|
||||||
// FIXME: We strip const here because the inst visitor strips const.
|
// FIXME: We strip const here because the inst visitor strips const.
|
||||||
visit(const_cast<Function &>(F));
|
visit(const_cast<Function &>(F));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user