[llvm-commits] CVS: llvm/lib/CodeGen/LiveVariables.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jul 9 11:45:01 PDT 2004


Changes in directory llvm/lib/CodeGen:

LiveVariables.cpp updated: 1.36 -> 1.37

---
Log message:

Add checks to ensure that there are no unreachable blocks in the function


---
Diffs of the changes:  (+8 -0)

Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.36 llvm/lib/CodeGen/LiveVariables.cpp:1.37
--- llvm/lib/CodeGen/LiveVariables.cpp:1.36	Thu Jul  1 01:15:32 2004
+++ llvm/lib/CodeGen/LiveVariables.cpp	Fri Jul  9 11:44:37 2004
@@ -291,6 +291,14 @@
                                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;
 }
 





More information about the llvm-commits mailing list