OSDN Git Service

[LCG] A NFC refactoring to extract the logic for doing
authorChandler Carruth <chandlerc@gmail.com>
Sun, 4 Sep 2016 08:34:24 +0000 (08:34 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 4 Sep 2016 08:34:24 +0000 (08:34 +0000)
commit443069cec2bed4fb1d4be84db3508e25648d7729
treeb6e04ec29f10ee6b0f6a1418c176227c2d23e4b1
parentcc6b354faf47090a10685b976ef53e1f4b1476ff
[LCG] A NFC refactoring to extract the logic for doing
a postorder-sequence based update after edge insertion into a generic
helper function.

This separates the SCC-specific logic into two fairly simple lambdas and
extracts the rest into a generic helper template function. I think this
is a net win on its own merits because it disentangles different pieces
of the algorithm. Now there is one place that does the two-step
partition to identify a set of newly connected components and at the
same time update the postorder sequence.

However, I'm also hoping to re-use this an upcoming patch to update
a cached post-order sequence of RefSCCs when doing the analogous update
to the RefSCC graph, and I don't want to have two copies.

The diff is quite messy but this really is just moving things around and
making types generic rather than specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280618 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LazyCallGraph.cpp