search for: v_result

Displaying 5 results from an estimated 5 matches for "v_result".

Did you mean: _result
2012 Mar 21
1
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
...rtual ~item_iterator(); > virtual bool next( item *result ) = 0; > }; > > I'm aware that LLVM doesn't know anything about C++ and that one way to call C++ functions is to wrap them in C thunks: > > extern "C" bool thunk_iterator_M_next( void *v_that, void *v_result ) { > item_iterator *const that = static_cast<item_iterator*>( v_that ); > item *const result = static_cast<item*>( v_result ); > return that->next( result ); > } > > extern "C" void thunk_iterator_M_delete( void *v_that ) { > item_iterat...
2012 Mar 15
3
[LLVMdev] Using JIT code to code a program to call C++
My project has a C++ library that I want to allow the user to use via some programming language to be JIT'd to call functions in said library. For the sake of simplicity, assume the library has classes like: class item { public: item(); item( int ); ~item(); // ... }; class item_iterator { public: virtual ~item_iterator(); virtual bool next( item *result ) = 0; };
2012 Mar 22
1
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
...>> virtual bool next( item *result ) = 0; >> }; >> >> I'm aware that LLVM doesn't know anything about C++ and that one way to call C++ functions is to wrap them in C thunks: >> >> extern "C" bool thunk_iterator_M_next( void *v_that, void *v_result ) { >> item_iterator *const that = static_cast<item_iterator*>( v_that ); >> item *const result = static_cast<item*>( v_result ); >> return that->next( result ); >> } >> >> extern "C" void thunk_iterator_M_delete( void *v_that...
2012 Mar 22
0
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
...ing. How is having the code that catches all exceptions in a separate function different from what I proposed (putting the try/catch in the thunks)? (Ideally, I want to minimize layers of function calls.) Again for reference: extern "C" bool thunk_iterator_M_next( void *v_that, void *v_result, dtor_pairs *dtors ) { try { item_iterator *const that = static_cast<item_iterator*>( v_that ); item *const result = static_cast<item*>( v_result ); return that->next( result ); } catch ( ... ) { run_dtors( dtors );...
2012 Mar 23
2
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
...n calls.) Again for reference: > No reason. But if you have the 'try{}catch(...){}', then it should run the d'tors for you. There's no reason for you to have a "run_dtors" function there. -bw > extern "C" bool thunk_iterator_M_next( void *v_that, void *v_result, > dtor_pairs *dtors ) { > try { > item_iterator *const that = static_cast<item_iterator*>( v_that ); > item *const result = static_cast<item*>( v_result ); > return that->next( result ); > } > catch...