[PATCH] D134072: [Support] Provide access to the full mapping in llvm::Annotations

Yitzhak Mandelbaum via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 11:57:20 PDT 2022


ymandel accepted this revision.
ymandel added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/include/llvm/Testing/Support/Annotations.h:76
+  /// Returns the mapping of all names of points marked in the text to their
+  /// position. Unnamed points are marked to the empty string.
+  const llvm::StringMap<llvm::SmallVector<size_t, 1>> &all_points() const;
----------------



================
Comment at: llvm/unittests/Support/AnnotationsTest.cpp:19-22
+      testing::AllOf(
+          testing::ResultOf([](const auto &entry) { return entry.getKey(); },
+                            first_matcher),
+          testing::ResultOf([](const auto &entry) { return entry.getValue(); },
----------------
Use `using` decls for these?


================
Comment at: llvm/unittests/Support/AnnotationsTest.cpp:92
+      UnorderedElementsAre(
+          pair("", ElementsAre(range(0, 0), range(3, 4), range(3, 4))),
+          pair("outer", ElementsAre(range(2, 7), range(8, 10))),
----------------
why `ElementsAre` vs `UnorderedElementsAre`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134072/new/

https://reviews.llvm.org/D134072



More information about the llvm-commits mailing list