[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)
commit1f621f0a70e307455b000118838df2f155c5ea50
tree78999663bc4402bdd03666c364b4a4e5e7257bed
parentabd15f69b2957a38bb2f625eec8b21880004ec9e
[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.

llvm-svn: 280618
llvm/lib/Analysis/LazyCallGraph.cpp