Fix this assert. IP can point to an instruction with strange dominance

properties (invoke). Just assert that the instruction we return dominates
the insertion point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151511 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2012-02-27 02:13:03 +00:00
parent 930a1ebd92
commit 23b6ec906a
2 changed files with 50 additions and 15 deletions
@@ -38,3 +38,33 @@ bb8:
bb9:
resume { i8*, i32 } zeroinitializer
}
define void @h() {
bb1:
invoke void @g() optsize
to label %bb2 unwind label %bb5
bb2:
%arrayctor.cur = phi i8* [ undef, %bb1 ], [ %arrayctor.next, %bb3 ]
invoke void @g() optsize
to label %bb3 unwind label %bb6
bb3:
%arrayctor.next = getelementptr inbounds i8* %arrayctor.cur, i64 1
br label %bb2
bb4:
ret void
bb5:
%tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
cleanup
invoke void @g() optsize
to label %bb4 unwind label %bb7
bb6:
%tmp1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
cleanup
%arraydestroy.isempty = icmp eq i8* undef, %arrayctor.cur
ret void
bb7:
%lpad.nonloopexit = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
ret void
}