Displaying 4 results from an estimated 4 matches for "divisionbyzeroexception".
2010 Sep 26
0
[LLVMdev] LLVM Exception Handling
...September 2010 13:08, Eugene Toder <eltoder at gmail.com> wrote:
> %s = invoke i32 @v(i32 %o) to label %ok
> unwind %x to label %catch
> ok:
> ret i32 %s
>
> catch:
> %type = call i32 @exception_type(i8* %x)
> %r = icmp eq i32 %type, 255 ; 255 is DivisionByZeroException type
> br i1 %r, label %bad, label %worse
>
> bad:
> ret i32 -1
>
> worse:
> ret i32 -2
> }
That could be enough for SJ/LJ (I have no idea), but it certainly is
not for Dwarf exceptions. When an invoke throws an exception, the flow
doesn't go directly to the catch ar...
2010 Sep 26
4
[LLVMdev] LLVM Exception Handling
...produces a different value depending on whether if
; branches to the success case or the failure case.
%s = invoke i32 @v(i32 %o) to label %ok
unwind %x to label %catch
ok:
ret i32 %s
catch:
%type = call i32 @exception_type(i8* %x)
%r = icmp eq i32 %type, 255 ; 255 is DivisionByZeroException type
br i1 %r, label %bad, label %worse
bad:
ret i32 -1
worse:
ret i32 -2
}
Nathan -- is this approach simpler than using intrinsics @eh.throw
(assuming it's added) and @eh.exception? The latter seems more
flexible in supporting various levels of ABI (I think ideally LLVM
exception h...
2010 Sep 26
0
[LLVMdev] LLVM Exception Handling
On 25 September 2010 23:46, Nathan Jeffords <blunted2night at gmail.com> wrote:
> catch:
> %v = ptrtoint i8 * %x to i32
> %r = icmp eq i32 %v, 255
> br i1 %r, label %bad, label %worse
> bad:
> ret i32 -1
> worse:
> ret i32 -2
> }
If I understood correctly, you're trying to pass the clean-up flag
through %x directly on the invoke call. But later avoid
2010 Sep 25
3
[LLVMdev] LLVM Exception Handling
Hi guys,
I have begun a modification to the invoke/unwind instructions. The following
.ll file demonstrates the change.
define i32 @v(i32 %o) {
%r = icmp eq i32 %o, 0
br i1 %r, label %raise, label %ok
ok:
%m = mul i32 %o, 2
ret i32 %m
raise:
%ex = inttoptr i32 255 to i8 *
; unwind now takes an i8* "exception" pointer
unwind i8* %ex
}
define i32 @g(i32 %o) {
entry: