From 9f2150c0466e7061985171ce46c15912a7d8398c Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 23 Apr 2014 23:51:07 +0000 Subject: [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 --- include/llvm/Analysis/CGSCCPassManager.h | 6 +++--- include/llvm/Analysis/LazyCallGraph.h | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'include') 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(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 { + : public std::iterator { 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(); -- cgit v1.2.3