About LowerEH_RETURN

Hi All,

I am working on LowerEH_RETURN to lower builtin_eh_return (offset, handler). What I am trying to do is,

  1. compute the new sp with the offset.

  2. store the handler on the memory pointed by the new sp.

  3. update current sp to the new sp.

Below picture illustrates the scenario more clearly.

螢幕快照 2018-03-22 下午7.40.26.png

​In LoweEH_RETURN, ​I would like to compute the new sp with (fp + ??? + offset), and store handler there. The stack area at ??? seems to be used to store callee-saved register and something else. I don’t know how to get the correct ??? though.

Should I take a look on FRAME_TO_ARGS_OFFSET [1], or there is another way to achieve what I want? Thanks.

[1] http://llvm.org/doxygen/namespacellvm_1_1ISD.html#a22ea9cec080dd5f4f47ba234c2f59110a228deacdfba1bd2d5a3663b19609f945
​ ​

​Regards,
chenwj​