[llvm] [llvm] Construct SmallVector with iterator ranges (NFC) (PR #136460)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 13:18:17 PDT 2025


================
@@ -515,9 +515,7 @@ PreservedAnalyses CGSCCToFunctionPassAdaptor::run(LazyCallGraph::SCC &C,
   FunctionAnalysisManager &FAM =
       AM.getResult<FunctionAnalysisManagerCGSCCProxy>(C, CG).getManager();
 
-  SmallVector<LazyCallGraph::Node *, 4> Nodes;
-  for (LazyCallGraph::Node &N : C)
-    Nodes.push_back(&N);
+  SmallVector<LazyCallGraph::Node *, 4> Nodes(llvm::make_pointer_range(C));
----------------
dwblaikie wrote:

Oh, I guess maybe it needs a deduction guide? I guess standard containers don't have this and have an ctor with the from_range tag parameter, etc, so they aren't going for implicit conversion between containers/ranges anyway. So, guess leave it as-is.

https://github.com/llvm/llvm-project/pull/136460


More information about the llvm-commits mailing list