summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-09 16:44:37 +0000
committerChris Lattner <sabre@nondot.org>2004-07-09 16:44:37 +0000
commitd47909e00ab650fcd36952aeed3a003f3b37aab5 (patch)
tree8680a7f461b8064ea812f1ea5bfdcc4b680b4fe8 /llvm/lib/CodeGen/LiveVariables.cpp
parentc18917c85cccbfb9bda2c09ee0335be2ca61456b (diff)
downloadbcm5719-llvm-d47909e00ab650fcd36952aeed3a003f3b37aab5.tar.gz
bcm5719-llvm-d47909e00ab650fcd36952aeed3a003f3b37aab5.zip
Add checks to ensure that there are no unreachable blocks in the function
llvm-svn: 14725
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index cc924c3cc44..d26848cb1c6 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud