[llvm] [MemProf] Convert CallContextInfo to a struct (NFC) (PR #108086)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 15:31:50 PDT 2024


================
@@ -1474,14 +1486,14 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::updateStackNodes() {
     // that to sort by.
     DenseMap<const FuncTy *, unsigned> FuncToIndex;
     for (const auto &[Idx, CallCtxInfo] : enumerate(Calls))
-      FuncToIndex.insert({std::get<2>(CallCtxInfo), Idx});
+      FuncToIndex.insert({CallCtxInfo.Func, Idx});
     std::stable_sort(
         Calls.begin(), Calls.end(),
         [&FuncToIndex](const CallContextInfo &A, const CallContextInfo &B) {
-          auto &IdsA = std::get<1>(A);
-          auto &IdsB = std::get<1>(B);
-          auto *FuncA = std::get<2>(A);
-          auto *FuncB = std::get<2>(B);
+          auto &IdsA = A.StackIds;
+          auto &IdsB = B.StackIds;
+          auto *FuncA = A.Func;
+          auto *FuncB = B.Func;
----------------
teresajohnson wrote:

done

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


More information about the llvm-commits mailing list