diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-23 23:51:07 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-23 23:51:07 +0000 |
commit | 9f2150c0466e7061985171ce46c15912a7d8398c (patch) | |
tree | 04e3237db4d22746c22d850fb36d7c99dfc14a31 /include | |
parent | e3273c50a2b325e49df8fa60dd1802bc7772a656 (diff) | |
download | llvm-9f2150c0466e7061985171ce46c15912a7d8398c.tar.gz llvm-9f2150c0466e7061985171ce46c15912a7d8398c.tar.bz2 llvm-9f2150c0466e7061985171ce46c15912a7d8398c.tar.xz |
[LCG] Normalize the post-order SCC iterator to just iterate over the SCC
values rather than having pointers in weird places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/CGSCCPassManager.h | 6 | ||||
-rw-r--r-- | include/llvm/Analysis/LazyCallGraph.h | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/include/llvm/Analysis/CGSCCPassManager.h b/include/llvm/Analysis/CGSCCPassManager.h index 618fee153c..09101ae6d0 100644 --- a/include/llvm/Analysis/CGSCCPassManager.h +++ b/include/llvm/Analysis/CGSCCPassManager.h @@ -334,8 +334,8 @@ public: LazyCallGraph &CG = AM->getResult<LazyCallGraphAnalysis>(M); PreservedAnalyses PA = PreservedAnalyses::all(); - for (LazyCallGraph::SCC *C : CG.postorder_sccs()) { - PreservedAnalyses PassPA = Pass.run(C, &CGAM); + for (LazyCallGraph::SCC &C : CG.postorder_sccs()) { + PreservedAnalyses PassPA = Pass.run(&C, &CGAM); // We know that the CGSCC pass couldn't have invalidated any other // SCC's analyses (that's the contract of a CGSCC pass), so @@ -343,7 +343,7 @@ public: // FIXME: This isn't quite correct. We need to handle the case where the // pass updated the CG, particularly some child of the current SCC, and // invalidate its analyses. - CGAM.invalidate(C, PassPA); + CGAM.invalidate(&C, PassPA); // Then intersect the preserved set so that invalidation of module // analyses will eventually occur when the module pass completes. diff --git a/include/llvm/Analysis/LazyCallGraph.h b/include/llvm/Analysis/LazyCallGraph.h index d0de2aab10..039b8d7752 100644 --- a/include/llvm/Analysis/LazyCallGraph.h +++ b/include/llvm/Analysis/LazyCallGraph.h @@ -248,8 +248,7 @@ public: /// always visits SCCs for a callee prior to visiting the SCC for a caller /// (when they are in different SCCs). class postorder_scc_iterator - : public std::iterator<std::forward_iterator_tag, SCC *, ptrdiff_t, SCC *, - SCC *> { + : public std::iterator<std::forward_iterator_tag, SCC> { friend class LazyCallGraph; friend class LazyCallGraph::Node; @@ -276,8 +275,8 @@ public: return !operator==(Arg); } - reference operator*() const { return C; } - pointer operator->() const { return operator*(); } + reference operator*() const { return *C; } + pointer operator->() const { return &operator*(); } postorder_scc_iterator &operator++() { C = G->getNextSCCInPostOrder(); |