This should hopefully fix the exception handling issues in PR24792.
There are two things I'd appreciate an opinion on:
a) Does it make sense to expose it like this to FrameLowering, or should the interface be more abstract, and actually turned into a .cfi_escape somewhere lower?
b) I'm not sure how to optimize away consequent directives that provide the same size. I don't think this can be done in eliminateCallFramePseudoInstr(), because (1) it's not guaranteed to be called in program order (even though in practice I think that is what happens when we have pushes), and (2) I think the basic-block order can change later on.
It may make sense to eliminate the redundant directives somewhere in the MC layer, but I'm not sure where that can fit in. Any suggestions?
!Values.empty()