[cfe-dev] Refactoring the dominators patch for Clang
Ted Kremenek
kremenek at apple.com
Mon Nov 7 19:08:36 PST 2011
On Nov 3, 2011, at 10:50 AM, Ted Kremenek wrote:
> On Nov 2, 2011, at 4:23 PM, Anna Zaks wrote:
>
>> 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().
>
> Both of these seem reasonable to me.
>
Looking back at this comment, I think the Dominators algorithm should not rely on the existence of a 'getEntryBlock()' and really just being using GraphTraits that can get the entrance of the graph. We shouldn't have to rename anything in the CFG just to get the dominators analysis to work. If we are missing a concept, that is one thing, but renaming something means that the dominators analysis is relying on particular methods being present. That just feels really wrong to me. As I mentioned in another email I just sent, there is also no reason for the dominators analysis to have any notion of "basic blocks" either since it is a generic graph algorithm.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111107/3a53d9e2/attachment.html>
More information about the cfe-dev
mailing list