Displaying 20 results from an estimated 29 matches for "eh_ptr".
2007 Dec 09
0
[LLVMdev] Darwin vs exceptions
...we agree on what
the problem is. Suppose we don't artificially add catch-alls to selectors. Then
the above example compiles to:
define void @_Z1fv() {
...
invoke void @__cxa_throw( something ) noreturn
to label %somewhere unwind label %lpad
...
lpad:
%eh_ptr = tail call i8* @llvm.eh.exception( )
%eh_select8 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*))
tail call i32 (...)* @_Unwind_Resume( i8* %eh_ptr )
unreachable
...
}
define i32 @main() {
entry:...
2007 Dec 09
3
[LLVMdev] Darwin vs exceptions
(Mail system seems to have eaten this, sorry if it's a repeat)
On Dec 8, 2007, at 12:48 AM, Duncan Sands wrote:
> Hi Dale,
>
>> - Why was C++ claiming that every selector has a catch-all handler?
>
> this is easy: because the semantics of invoke require it. Yes,
> really.
> If unwinding reaches an invoke then control is required to jump to the
> unwind basic
2009 May 12
1
[LLVMdev] How distinguish Catch all llvm-IR from other catch type ?
...struct.__fundamental_type_info_pseudo* @_ZTIi to i8*), void (i8*)*
null) noreturn
14 to label %invcont unwind label %lpad
15
16 invcont: ; preds = %entry
17 unreachable
18
19 lpad: ; preds = %entry
20 %eh_ptr = tail call i8* @llvm.eh.exception()
; <i8*> [#uses=2]
21 %eh_select = tail call i32 (i8*, i8*, ...)*
@llvm.eh.selector.i32(i8* %eh_ptr, i8* bitcast (i32 (...)*
@__gxx_personality_sj0 to i8*)) ; <i32> [#uses=0]
22 %2 = tail call i8* @__cxa_begin_catch...
2007 Dec 12
0
[LLVMdev] Darwin vs exceptions
...i;
extern void f();
void g() { try { f(); } catch(A) { i = 1; } }
void h() { try { g(); } catch(B) { i = 2; } }
Without catch-alls this compiles to something like:
define void @_Z1gv() {
entry:
invoke void @_Z1fv( )
to label %UnifiedReturnBlock unwind label %lpad
...
lpad: ; preds = %entry
%eh_ptr = tail call i8* @llvm.eh.exception( )
%eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i32 (...)* @__gxx_personality_v0, i8* A)
%eh_typeid = tail call i32 @llvm.eh.typeid.for.i32( i8* A )
%tmp15 = icmp eq i32 %eh_select, %eh_typeid
br i1 %tmp15, label %bb, label %...
2010 Dec 07
0
[LLVMdev] RFC: Exception Handling Proposal Revised
Hi Bill, there are a couple of things I didn't understand about your proposal,
for example how it interacts with inlining, whether it is feasible to do the
"turn invoke-of-Unwind_Resume into a branch" optimization and also whether in
"resumedest" you still plan to use _Unwind_Resume to continue unwinding up the
stack. Could you please show what the LLVM IR would look like
2007 Dec 10
3
[LLVMdev] Darwin vs exceptions
On Dec 10, 2007, at 11:38 AM, Duncan Sands wrote:
>>> ... If you force a "cleanup" by changing the selector call to:
>>> %eh_select8.i = tail call i32 (i8*, i8*, ...)*
>>> @llvm.eh.selector.i32( i8* %eh_ptr.i, i8* bitcast (i32 (...)*
>>> @__gxx_personality_v0 to i8*), i32 0)
>>> then it doesn't work either: the unwinder observes that there is
>>> only a cleanup, and
>>> using some special logic (bogus in this case) deduces that the
>>> exception will be...
2007 Dec 10
3
[LLVMdev] Darwin vs exceptions
...n't artificially add catch-alls to
> selectors. Then
> the above example compiles to:
>
> define void @_Z1fv() {
> ...
> invoke void @__cxa_throw( something ) noreturn
> to label %somewhere unwind label %lpad
> ...
> lpad:
> %eh_ptr = tail call i8* @llvm.eh.exception( )
> %eh_select8 = tail call i32 (i8*, i8*, ...)*
> @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)*
> @__gxx_personality_v0 to i8*))
I wasn't advocating this; agree it is wrong.
> tail call i32 (...)* @_Unwind_Resume...
2009 Apr 28
3
[LLVMdev] how to resolve llvm exception IR?
...ZTIi to i8*), void (i8*)*
null) noreturn
52 to label %invcont unwind label %lpad
53
54 invcont: ; preds = %entry
55 unreachable
56
57 bb: ; preds = %lpad
58 %2 = tail call i8* @__cxa_begin_catch(i8* %eh_ptr)
nounwind ; <i8*> [#uses=0]
59 %3 = invoke
%"struct.std::basic_ostream<char,std::char_traits<char> >"*
@_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream<char,std::char_traits<char>
>"* @_ZS...
2009 May 20
2
[LLVMdev] Getting exceptions to work?
...;
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_personality_v0 to i8*),
i32 1)
call void @print(i8* bitc...
2009 May 12
2
[LLVMdev] catch all
Hi,
that's right ! catch(all) has extra null arg,
eh_select = tail call i32 (i8*, i8*, ...)*
@llvm.eh.selector.i32(i8* %eh_ptr, i8* bitcast (i32 (...)*
@__gxx_personality_v0 to i8*), i8* null) ; <i32> [#uses=0]
I have doubt that :
the llvm-IR like above are all translated from catch(all) statement .
zhangzw
2010 Dec 01
10
[LLVMdev] RFC: Exception Handling Proposal Revised
...to label %bb2 unwind label %b.dtor
bb2:
invoke void @_ZN1BD1Ev(%struct.B* %b)
to label %bb3 unwind label %a.dtor
bb3:
invoke void @_ZN1AD1Ev(%struct.A* %a)
to label %return unwind label %catch.handlers
return:
ret void
;; Catch Handlers
catch.handlers: landingpad
%eh_ptr = call i8* @llvm.eh.exception()
dispatch resume to label %...
catches [
%struct.__fundamental_type_info_pseudo* @_ZTIi, label %ch.int
%struct.__pointer_type_info_pseudo* @_ZTIPKc, label %ch.str
]
catchall [i8* null, label % ch.ca]
ch.int:
%t0 = call i8* @__cxa_begin_cat...
2009 Nov 18
11
[LLVMdev] RFC: New Exception Handling Proposal
...;
} catch (...) {
printf("catch-all\n");
}
}
The llvm IR for foo looks similar to this (simplified for readability):
define void @_Z3foov() {
entry:
invoke void @_Z3barv()
to label %return unwind label %lpad
return:
ret void
lpad:
%eh_ptr = tail call i8* @llvm.eh.exception()
%eh_select27 = tail call i32 (i8*, i8*, ...)*
@llvm.eh.selector(i8* %eh_ptr,
i8* @__gxx_personality_v0,
i8* @_ZTIi,
i8* @_ZTIPKc,
i8* null)
%eh_t...
2009 May 12
0
[LLVMdev] catch all
> that's right ! catch(all) has extra null arg,
>
> eh_select = tail call i32 (i8*, i8*, ...)*
> @llvm.eh.selector.i32(i8* %eh_ptr, i8* bitcast (i32 (...)*
> @__gxx_personality_v0 to i8*), i8* null) ; <i32> [#uses=0]
>
> I have doubt that :
> the llvm-IR like above are all translated from catch(all) statement .
I'm not sure what you are saying...
Ciao,
Duncan.
2009 May 12
1
[LLVMdev] catch all
2009/5/12 Duncan Sands <baldrick at free.fr>:
>> that's right ! catch(all) has extra null arg,
>>
>> eh_select = tail call i32 (i8*, i8*, ...)*
>> @llvm.eh.selector.i32(i8* %eh_ptr, i8* bitcast (i32 (...)*
>> @__gxx_personality_v0 to i8*), i8* null) ; <i32> [#uses=0]
>>
>> I have doubt that :
>> the llvm-IR like above are all translated from catch(all) statement .
>
> I'm not sure what you are saying...
>
> Ciao,
>
&g...
2009 May 26
0
[LLVMdev] Exception Personality Function
...rent 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*),
%tart.reflect.Type* @tart.core.InvalidArgumentException.type,
%tart.reflect.Type* @tart.core.Thro...
2009 Nov 24
0
[LLVMdev] RFC: New Exception Handling Proposal
...}
> }
>
> The llvm IR for foo looks similar to this (simplified for readability):
>
> define void @_Z3foov() {
> entry:
> invoke void @_Z3barv()
> to label %return unwind label %lpad
>
> return:
> ret void
>
> lpad:
> %eh_ptr = tail call i8* @llvm.eh.exception()
> %eh_select27 = tail call i32 (i8*, i8*, ...)*
> @llvm.eh.selector(i8* %eh_ptr,
> i8* @__gxx_personality_v0,
> i8* @_ZTIi,
> i8* @_ZTIPKc,
>...
2009 May 20
0
[LLVMdev] Getting exceptions to work?
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*),
> i32 1)
try changing i32 1 to i32 0. Also, feel free to send me something
I can compile, and I will try it here.
Ciao,
Duncan.
2009 May 19
0
[LLVMdev] Getting exceptions to work?
Talin wrote:
> Nicolas Geoffray wrote:
>> Hi Talin,
>>
>> You're not using the llvm intrinsics for exception handling, so your
>> code won't work. Using _Unwind_RaiseException should be OK, but your
>> main function must at least use llvm.eh.exception,
>> llvm.eh.selector.i32/64 and probably __cxa_begin_catch and __cxa_end_catch.
>>
>
2009 Nov 20
0
[LLVMdev] RFC: New Exception Handling Proposal
... | | |
> `----------------+---------------'
> |
> v
> .----------------------------------------.
> | %sel = phi [%select.1, ..., %select.n] |
> | %eh_ptr = llvm.eh.exception() |
> | [cleanup code] |
> | switch on %sel |
> `----------------------------------------'
> |
> v
> .--...
2011 May 17
4
[LLVMdev] Exception Handling Proposal - Second round
...ly lists the possible catch areas, filters, personality and
belongs to a basic block, that needs an attribute "landingpad" to help
optimisations understand that that block is special for EH (this might
not be strictly necessary).
The general syntax of the dispatch is:
lpad: landingpad
%eh_ptr = tail call i8* @llvm.eh.exception()
dispatch region label %lpad resume to label %unwind
catches [
%struct.__fundamental_type_info_pseudo* @_ZTIi, label %ch.int.main
]
personality [i32 (...)* @__gxx_personality_v0]
This dispatch instruction is the last instruction in its block. It
e...