[cfe-commits] r123438 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Chris Lattner clattner at apple.com
Fri Jan 14 11:15:29 PST 2011


On Jan 14, 2011, at 2:35 AM, John McCall wrote:

> Author: rjmccall
> Date: Fri Jan 14 04:35:38 2011
> New Revision: 123438
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=123438&view=rev
> Log:
> When simplifying a cleanup's entry by merging it into a single predecessor,
> replace all uses of the entry with the predecessor.  There are no cleanups
> relying on this right now, but if we ever want a cleanup with a phi inside
> it, this will be important.

Hi John,

It might be best to call MergeBlockIntoPredecessor, which is defined in llvm/Transforms/Utils/BasicBlockUtils.h.

-Chris

> 
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=123438&r1=123437&r2=123438&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri Jan 14 04:35:38 2011
> @@ -754,6 +754,10 @@
>   // Merge the blocks.
>   Pred->getInstList().splice(Pred->end(), Entry->getInstList());
> 
> +  // Replace all uses of the entry with the predecessor, in case there
> +  // are phis in the cleanup.
> +  Entry->replaceAllUsesWith(Pred);
> +
>   // Kill the entry block.
>   Entry->eraseFromParent();
> 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list