diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-09 16:44:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-09 16:44:37 +0000 |
commit | 9fb6cf1d82617994cd6dad33ecd45c1e913534aa (patch) | |
tree | a7965c4b18573183d8a3924a7140fc2777c5b9cb /lib/CodeGen/LiveVariables.cpp | |
parent | 8ca2dc0710dd7d68651c3750441f6e96c2534979 (diff) |
Add checks to ensure that there are no unreachable blocks in the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index cc924c3cc4..d26848cb1c 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -291,6 +291,14 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) { i + MRegisterInfo::FirstVirtualRegister)); } + // Check to make sure there are no unreachable blocks in the MC CFG for the + // function. If so, it is due to a bug in the instruction selector or some + // other part of the code generator if this happens. +#ifndef NDEBUG + for(MachineFunction::iterator i = MF.begin(), e = MF.end(); i != e; ++i) + assert(Visited.count(&*i) != 0 && "unreachable basic block found"); +#endif + return false; } |