MachineBasicBlock: Factor out common code into isReturnBlock()
[oota-llvm.git] / lib / Target / PowerPC / PPCISelDAGToDAG.cpp
index 30d792e0bbc2bee64191b6526de83bed218dd440..4fd57be8c9db2417f2c2ecd94583fa47f885c555 100644 (file)
@@ -286,7 +286,7 @@ void PPCDAGToDAGISel::InsertVRSaveCode(MachineFunction &Fn) {
 
   // Find all return blocks, outputting a restore in each epilog.
   for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
-    if (!BB->empty() && BB->back().isReturn()) {
+    if (BB->isReturnBlock()) {
       IP = BB->end(); --IP;
 
       // Skip over all terminator instructions, which are part of the return