[llvm][ADT] Overload output stream operator `<<` for `StringMapEntry` and `StringMap`.
authorWei Yi Tee <wyt@google.com>
Wed, 31 Aug 2022 17:21:33 +0000 (17:21 +0000)
committerWei Yi Tee <wyt@google.com>
Wed, 31 Aug 2022 17:37:58 +0000 (17:37 +0000)
commitd45c04da7cc5fd093f611c311d3b34b0ef408165
treee5f1fe9f8461b0538ffb82bc26bc86928989fa19
parent66f3e90cf8225333273bfaddc1a7f832fe0c263d
[llvm][ADT] Overload output stream operator `<<` for `StringMapEntry` and `StringMap`.

Printing support enables the production of more useful error messages in unit testing e.g. when using matchers such as `UnorderedElementsAre()` to inspect the contents of a `StringMap`.

Reviewed By: gribozavr2, sgatev, ymandel

Differential Revision: https://reviews.llvm.org/D132747
llvm/include/llvm/Testing/ADT/StringMap.h [new file with mode: 0644]
llvm/include/llvm/Testing/ADT/StringMapEntry.h [new file with mode: 0644]
llvm/unittests/Testing/ADT/CMakeLists.txt [new file with mode: 0644]
llvm/unittests/Testing/ADT/StringMapTest.cpp [new file with mode: 0644]
llvm/unittests/Testing/CMakeLists.txt
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel