[LLVMdev] unwind/invoke design
Duncan Sands
baldrick at free.fr
Mon Jun 15 23:42:36 PDT 2009
Hi Wesley,
> Why does 'unwind' need to setup thread local storage at all? In my
> opinion this is the responsibility of the frontend, not LLVM. All I
> expect 'unwind' to do is unwind the stack down to the nearest 'unwind
> label' of an invoke.
sure, but how is it to do that? Answer: using the libgcc unwinder
routines (another possibility is to use libunwind, which seems better
adapted to this but unfortunately isn't available everywhere). But
the libgcc unwinder requires you to supply some storage for it, and
I don't see that you have any choice except to use thread-local
storage.
Thread-local storage, global variable, or any
> other approach one might think of to carry the exception information
> is a frontend policy decision. Adding this support to 'unwind'
> complicates its implementation and also dilutes its usefulness.
It would be entirely for technical reasons, see above.
Ciao,
Duncan.
More information about the llvm-dev
mailing list