This is the first attempt to write down a guideline on adding exception handling support for a target. The content basically bases on the discussion on [1]. If you guys know who is exception handling expert, please add him as the reviewer. Thanks.
[1] http://lists.llvm.org/pipermail/llvm-dev/2018-January/120405.html
Most of this is generic code. The important thing for the back end is to make sure that every register has a unique DWARF number.
In your TargetFrameLowering's emitPrologue method, you must add the .cfi_def_cfa_offset directive for the frame and then the .cfi_def_cfa_register or similar to tell the unwinder the base address for all subsequent offsets.