[llvm] fa46d52 - [llvm-xray] Use llvm::make_second_range (NFC) (#135989)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 12:29:37 PDT 2025


Author: Kazu Hirata
Date: 2025-04-16T12:29:33-07:00
New Revision: fa46d522fe66b77bdf3156be9255ce3b83010433

URL: https://github.com/llvm/llvm-project/commit/fa46d522fe66b77bdf3156be9255ce3b83010433
DIFF: https://github.com/llvm/llvm-project/commit/fa46d522fe66b77bdf3156be9255ce3b83010433.diff

LOG: [llvm-xray] Use llvm::make_second_range (NFC) (#135989)

Added: 
    

Modified: 
    llvm/tools/llvm-xray/xray-stacks.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-xray/xray-stacks.cpp b/llvm/tools/llvm-xray/xray-stacks.cpp
index cbf6faeb32960..b11d732a4fcc0 100644
--- a/llvm/tools/llvm-xray/xray-stacks.cpp
+++ b/llvm/tools/llvm-xray/xray-stacks.cpp
@@ -495,15 +495,8 @@ class StackTrie {
   void printIgnoringThreads(raw_ostream &OS, FuncIdConversionHelper &FN) {
     RootVector RootValues;
 
-    // Function to pull the values out of a map iterator.
-    using RootsType = decltype(Roots.begin())::value_type;
-    auto MapValueFn = [](const RootsType &Value) { return Value.second; };
-
-    for (const auto &RootNodeRange :
-         make_range(map_iterator(Roots.begin(), MapValueFn),
-                    map_iterator(Roots.end(), MapValueFn))) {
+    for (const auto &RootNodeRange : make_second_range(Roots))
       llvm::append_range(RootValues, RootNodeRange);
-    }
 
     print(OS, FN, RootValues);
   }


        


More information about the llvm-commits mailing list