Attempt to fix breakage from r128782 reported by Francois Pichet on
llvm-commits.  (Not sure why it only breaks on Windows; maybe it has
something to do with the iterator representation...)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128802 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 26ae295..d7e2336 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -333,6 +333,9 @@
       continue;
     }
 
+    if (Inst->isTerminator())
+      break;
+
     WeakVH BIHandle(BI);
     MadeChange |= RecursivelyDeleteTriviallyDeadInstructions(Inst);
     if (BIHandle != BI)