[LLVMdev] exact semantics of 'nounwind'

Nick Lewycky
2008-03-13T04:54:27Z

Hi everyone,

Since I'm busy muddying the waters by changing how exception handling
works, I thought I should ask for clarification on the exact behaviour
of the current 'nounwind' attribute found on functions, calls and
invokes.

I was thinking these would be similar to the AA analysis notes like
"doesNotAccessMemory" which is a provable property of the function or
call site being analyzed. Duncan mentioned that doesNotThrow is actually
an important language semantic meaning that an unwind calls a
language-defined behaviour such as calling terminate(). What happens in
other languages?

Chris and I also couldn't agree on what the semantics ought to be going
forward. He suggested having two bits, one to memoize an analysis
proving that it can't unwind, and one to mean that an unwind triggers
terminate. I happen to think that this ought to be explicitly modelled
in the IR by arcing to another BB that calls terminate.

We do agree that we need crystal-clear semantics in the language, so I'm
taking it to the mailing list to see what if we can form a consensus.

Nick