[llvm-commits] [llvm] r94046 - /llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp

Duncan Sands baldrick at free.fr
Wed Jan 20 23:19:54 PST 2010


Hi Jim,

> +      // The SjLj dispatch block uses a switch instruction. This is effectively
> +      // an unwind edge, so we can disregard it here. There will only ever
> +      // be one dispatch, however, so if there are multiple switches, one
> +      // of them truly is a normal edge, not an unwind edge.
> +      if (SwitchOK && isa<SwitchInst>(PT)) {
> +        SwitchOK = false;
> +        continue;
> +      }

it seems to me that this is only correct if SjLj *always* introduces a switch
that branches to the edge.  Otherwise you can't know if a switch came from
the original code or from SjLj lowering.  Can you please clarify.  Also, rather
than doing this:

+  bool usingSjLjEH = MAI->getExceptionHandlingType() == ExceptionHandling::SjLj;

you could pass it in as a boolean to the pass constructor.  Finally, I don't
much like passes magically knowing which other passes have run and what they
have been up to - very GCC like :)  That said, I don't immediately see a nicer
solution.

Ciao,

Duncan.



More information about the llvm-commits mailing list