[llvm] r277913 - [CallGraphSCCPass] Use an ArrayRef instead of a pair of iterators

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 23:21:03 PDT 2016


Author: majnemer
Date: Sat Aug  6 01:21:02 2016
New Revision: 277913

URL: http://llvm.org/viewvc/llvm-project?rev=277913&view=rev
Log:
[CallGraphSCCPass] Use an ArrayRef instead of a pair of iterators

No functional change is intended.

Modified:
    llvm/trunk/include/llvm/Analysis/CallGraphSCCPass.h
    llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp

Modified: llvm/trunk/include/llvm/Analysis/CallGraphSCCPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraphSCCPass.h?rev=277913&r1=277912&r2=277913&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/CallGraphSCCPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/CallGraphSCCPass.h Sat Aug  6 01:21:02 2016
@@ -94,8 +94,8 @@ class CallGraphSCC {
 public:
   CallGraphSCC(CallGraph &cg, void *context) : CG(cg), Context(context) {}
 
-  void initialize(CallGraphNode *const *I, CallGraphNode *const *E) {
-    Nodes.assign(I, E);
+  void initialize(ArrayRef<CallGraphNode *> NewNodes) {
+    Nodes.assign(NewNodes.begin(), NewNodes.end());
   }
 
   bool isSingular() const { return Nodes.size() == 1; }

Modified: llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp?rev=277913&r1=277912&r2=277913&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp (original)
+++ llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp Sat Aug  6 01:21:02 2016
@@ -450,7 +450,7 @@ bool CGPassManager::runOnModule(Module &
     // Copy the current SCC and increment past it so that the pass can hack
     // on the SCC if it wants to without invalidating our iterator.
     const std::vector<CallGraphNode *> &NodeVec = *CGI;
-    CurSCC.initialize(NodeVec.data(), NodeVec.data() + NodeVec.size());
+    CurSCC.initialize(NodeVec);
     ++CGI;
 
     // At the top level, we run all the passes in this pass manager on the




More information about the llvm-commits mailing list