Users have complained llvm.trap produce two ud2 instructions on Win64,
one for the trap, and one for unreachable. This change fixes that.
TrapUnreachable was added and enabled for Win64 in r206684 (April 2014)
to avoid issues where the unwinder would disassemble forward from a
call's return address and go off the rails. Some of my experiments show
that the unwinder will sometimes use the unwind info from the next
function to unwind, if you arrange for the throwing call to end on a
16-byte aligned boundary. By trapping on unreachable, we ensured that
noreturn calls would always have some real instructions after the return
address, so the return address would be inside the bounds of the region
described by the unwind info.
Instead, this change inserts a new pseudo instruction, SEH_NoReturn,
which expands to an int3 if it happens to be the last instruction in the
current funclet after basic block layout. This approach is similar to
the approach we took with SEH_Epilogue, which expands to a nop if there
is a call immediately preceding the pseudo instruction.