Displaying 9 results from an estimated 9 matches for "throwsomething".
2009 May 18
4
[LLVMdev] Getting exceptions to work?
...y life immensely better.
; ModuleID = 'ExceptionTest'
%Object = type {}
%UnwindInfo = type { i64, void (i32, %UnwindInfo *)*, i16, i16 }
%Throwable = type { %Object, %UnwindInfo }
define i32 @main(i32, i8**) nounwind {
entry:
invoke fastcc void @throwSomething() to label %nounwind unwind
label %catch
catch:
ret i32 0
nounwind:
ret i32 -1
}
define internal fastcc void @throwSomething() noreturn {
entry:
%throwable = malloc %Throwable
call fastcc void @Throwable.construct(%Throwable* %throwable)...
2009 May 21
0
[LLVMdev] Getting exceptions to work?
Hi Talin, if you change @throwSomething so that it prints a message
if the _Unwind_RaiseException call returns, then you will see that
it does in fact return.
define internal fastcc void @throwSomething() {
entry:
%throwable = malloc %Throwable
call fastcc void @Throwable.construct(%Throwable* %throwable)
%unw...
2009 May 20
3
[LLVMdev] Getting exceptions to work?
Duncan Sands wrote:
> Hi Talin,
>
>> So I tried what you suggested, and it just gives me a bus error:
>>
>> %eh_select34 = call i32 (i8*, i8*, ...)*
>> @llvm.eh.selector.i32 (
>> i8* %eh_ptr,
>> i8* bitcast (i32 (i32, i32, i64, i8*, %UnwindContext*)*
>> @__gcc_personality_v0 to i8*),
>>
2009 May 18
0
[LLVMdev] Getting exceptions to work?
...; ModuleID = 'ExceptionTest'
> %Object = type {}
> %UnwindInfo = type { i64, void (i32, %UnwindInfo *)*, i16, i16 }
> %Throwable = type { %Object, %UnwindInfo }
>
> define i32 @main(i32, i8**) nounwind {
> entry:
> invoke fastcc void @throwSomething() to label %nounwind unwind
> label %catch
>
> catch:
> ret i32 0
>
> nounwind:
> ret i32 -1
> }
>
> define internal fastcc void @throwSomething() noreturn {
> entry:
> %throwable = malloc %Throwable
> call fastcc...
2009 May 19
5
[LLVMdev] Getting exceptions to work?
...nTest'
>> %Object = type {}
>> %UnwindInfo = type { i64, void (i32, %UnwindInfo *)*, i16, i16 }
>> %Throwable = type { %Object, %UnwindInfo }
>>
>> define i32 @main(i32, i8**) nounwind {
>> entry:
>> invoke fastcc void @throwSomething() to label %nounwind unwind
>> label %catch
>>
>> catch:
>> ret i32 0
>>
>> nounwind:
>> ret i32 -1
>> }
>>
>> define internal fastcc void @throwSomething() noreturn {
>> entry:
>> %throwa...
2009 May 24
1
[LLVMdev] Getting exceptions to work?
Well, after much labor, I think I have managed to create a personality
function that works. But I must say it is frightening how complicated
all of this stuff is.
-- Talin
Duncan Sands wrote:
> Hi Talin, if you change @throwSomething so that it prints a message
> if the _Unwind_RaiseException call returns, then you will see that
> it does in fact return.
>
> define internal fastcc void @throwSomething() {
> entry:
> %throwable = malloc %Throwable
> call fastcc void @Throwable.construct(%Th...
2009 May 19
0
[LLVMdev] Getting exceptions to work?
...%Object = type {}
>>> %UnwindInfo = type { i64, void (i32, %UnwindInfo *)*, i16, i16 }
>>> %Throwable = type { %Object, %UnwindInfo }
>>>
>>> define i32 @main(i32, i8**) nounwind {
>>> entry:
>>> invoke fastcc void @throwSomething() to label %nounwind unwind
>>> label %catch
>>>
>>> catch:
>>> ret i32 0
>>>
>>> nounwind:
>>> ret i32 -1
>>> }
>>>
>>> define internal fastcc void @throwSomething() noreturn {
&g...
2009 May 26
0
[LLVMdev] Exception Personality Function
...n isSubclass() method. This can serve as an
example for how to use exceptions for languages that are different from C++.
To invoke the personality function and have it catch an exception, the
IR that you generate should look like the following:
try:
;; Throw some exception
invoke { } @"throwSomething"() to label %endTry unwind label %catch
catch:
;; Catch and decode the exception
%eh_ptr = call i8* @llvm.eh.exception()
%eh_action = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(
i8* %eh_ptr,
i8* bitcast (i32 (i32, i32, i64, i8*, i8*)* @__tart_eh_personality
to i8*),
%t...
2009 May 20
2
[LLVMdev] Getting exceptions to work?
...nd target in the dwarf exception handling info in
> the object file.
>
>
So I tried what you suggested, and it just gives me a bus error:
define i32 @main(i32, i8**) nounwind {
entry:
call void @print(i8* bitcast ([6 x i8]* @str_begin to i8 *))
invoke fastcc void @throwSomething() to label %nounwind unwind
label %catch;
catch:
%eh_ptr = call i8* @llvm.eh.exception();
%eh_select34 = call i32 (i8*, i8*, ...)*
@llvm.eh.selector.i32 (
i8* %eh_ptr,
i8* bitcast (i32 (i32, i32, i64, i8*, %UnwindContext*)*
@__gcc_perso...