[cfe-dev] Refactoring the dominators patch for Clang

Anna Zaks ganna at apple.com
Wed Nov 2 16:23:13 PDT 2011


Hi Guoping,

It seems that the only reason why you need to copy the recalculate function is that the names for the entry block in the clang CFG and LLVM function are different. Is that correct? (The bool parameter does not seem to be used..)

A simple solution to that would be to make sure that we have the same name in both. I suggest using getEntryBlock().

On llvm's side, it would involve changing the recalculate function to use getEntryBlock instead of front(). Looks like they are the same thing.

On Clang's side, we could just rename CFG::getEntry()  -> CFG::getEntryBlock().

Thanks!
Anna.
On Oct 29, 2011, at 3:58 PM, Guoping Long wrote:

> Hi, Ted
> 
>    The preliminary refactoring of the dominators patch for clang based on the more efficient LLVM core implementation is done. Attached is the patch. I am not very satisfied with this version because it relies a ugly hack to deal with the subtle differences between LLVM Function and Clang CFG. Since this version requires some modifications to include/llvm/Analysis/Dominators.h, so there is also a patch for llvm. 
> 
>     While I believe there should be a cleaner way to do this, I do not know how to achieve that.  Please let me know your comments. I shall continue to improve until it become satisfactory.
>     Regards.
> 
> ----
> Guoping
> <dominators-clang.patch><dominators-llvm.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list