add an assertion to make it clear that PHI nodes are not allowed.
authorChris Lattner <sabre@nondot.org>
Wed, 18 Mar 2009 16:23:56 +0000 (16:23 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 18 Mar 2009 16:23:56 +0000 (16:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67210 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/DeadArgumentElimination.cpp

index 9f2b2a733ee8f858a4f39cf8182eec24ee029a7b..ab8df69845720d7befd733dabf8b6623581ac9ba 100644 (file)
@@ -802,8 +802,11 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
                "Return type changed, but not into a void. The old return type"
                " must have been a struct!");
         Instruction *InsertPt = Call;
-        if (InvokeInst *II = dyn_cast<InvokeInst>(Call))
+        if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
           InsertPt = II->getNormalDest()->begin();
+          assert(!isa<PHINode>(InsertPt) &&
+                "Can't have a use of the invoke value if the edge is critical");
+        }
           
         // We used to return a struct. Instead of doing smart stuff with all the
         // uses of this struct, we will just rebuild it using