[LLVMdev] RFC: Exception Handling Proposal II

Frits van Bommel fvbommel at gmail.com
Thu Nov 25 01:42:14 PST 2010


On Thu, Nov 25, 2010 at 8:49 AM, John McCall <rjmccall at apple.com> wrote:
> (†) Technically, there can be no true guarantee because the dispatch doesn't even need to be reachable from its landing pad.  For example:
>  extern void foo();
>  struct A { ~A() { throw 0; } };
>  void test() { A a; foo(); }
> After inlining, the cleanup landing pad in test() will contain a throw to a terminating handler, and therefore the dispatch will not be reachable.  So any constraint has to be something like "either the dispatch is unreachable or it's dominated by the entry to the landing pad".  But it's actually quite easy to write correct code to handle this case. :)

Doesn't "the dispatch is unreachable" already imply that it's
dominated by the landing pad? All paths to the dispatch (i.e. none at
all) will first go through the landing pad. So that constraint is just
"the dispatch is dominated by the entry to the landing pad".




More information about the llvm-dev mailing list