Question

llvm has a MachineVerifier pass which checks a MachineFunction for correctness based on different parameters like: liveness, dead Basic Block, correct register class etc. Recently I came across this error from the MachineVerifier pass. I'm wondering why is it not okay to have multiple landing pad successors? In the example I am getting this error the layout (IR) is like this;

BB0: 
...
succ: BB1


BB1: EH_LANDING_PAD
pred: BB0, BB1
...
succ: BB1, BB2


BB2: EH_LANDING_PAD
...

 Bad machine code: MBB has more than one landing pad successor ***
   - function:    _Z7ex_testv
   - basic block: BB#1 lpad (0x1bf7c90)
   LLVM ERROR: Found 1 machine code errors.

Does it mean that if an exception occurs, exception handling will be ambiguous. Can someone please explain. Thanks.

Was it helpful?

Solution

Yes. Multiple landing pads are prohibited. landing pad is where the exception is landed by the unwinder. Strictly speaking, there is no problem of handling the landing pads with non-intersecting typeinfo's, but when you have e.g. cleanup or filter you might end in the trouble...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top