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

This commit is contained in:
Kazu Hirata 2025-04-16 12:29:33 -07:00 committed by GitHub
parent 0f97cd87de
commit fa46d522fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -495,15 +495,8 @@ public:
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);
}