Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[formatters] Add a libstdcpp formatter for for unordered_map, unorder…
…ed_set, unordered_multimap, unordered_multiset This diff adds a data formatter and tests for libstdcpp's unordered_map, unordered_set, unordered_multimap, unordered_multiset Reviewed By: wallace Differential Revision: https://reviews.llvm.org/D113760
- Loading branch information
1 parent
2e6a0a8
commit fcd288b
Showing
7 changed files
with
174 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CXX_SOURCES := main.cpp | ||
|
||
include Makefile.rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#include <string> | ||
#include <unordered_map> | ||
#include <unordered_set> | ||
|
||
int g_the_foo = 0; | ||
|
||
int thefoo_rw(int arg = 1) { | ||
if (arg < 0) | ||
arg = 0; | ||
if (!arg) | ||
arg = 1; | ||
g_the_foo += arg; | ||
return g_the_foo; | ||
} | ||
|
||
int main() { | ||
std::unordered_map<int, std::string> map; | ||
map.emplace(1, "hello"); | ||
map.emplace(2, "world"); | ||
map.emplace(3, "this"); | ||
map.emplace(4, "is"); | ||
map.emplace(5, "me"); | ||
thefoo_rw(); // Set break point at this line. | ||
|
||
std::unordered_multimap<int, std::string> mmap; | ||
mmap.emplace(1, "hello"); | ||
mmap.emplace(2, "hello"); | ||
mmap.emplace(2, "world"); | ||
mmap.emplace(3, "this"); | ||
mmap.emplace(3, "this"); | ||
mmap.emplace(3, "this"); | ||
thefoo_rw(); // Set break point at this line. | ||
|
||
std::unordered_set<int> iset; | ||
iset.emplace(1); | ||
iset.emplace(2); | ||
iset.emplace(3); | ||
iset.emplace(4); | ||
iset.emplace(5); | ||
thefoo_rw(); // Set break point at this line. | ||
|
||
std::unordered_set<std::string> sset; | ||
sset.emplace("hello"); | ||
sset.emplace("world"); | ||
sset.emplace("this"); | ||
sset.emplace("is"); | ||
sset.emplace("me"); | ||
thefoo_rw(); // Set break point at this line. | ||
|
||
std::unordered_multiset<int> imset; | ||
imset.emplace(1); | ||
imset.emplace(2); | ||
imset.emplace(2); | ||
imset.emplace(3); | ||
imset.emplace(3); | ||
imset.emplace(3); | ||
thefoo_rw(); // Set break point at this line. | ||
|
||
std::unordered_multiset<std::string> smset; | ||
smset.emplace("hello"); | ||
smset.emplace("world"); | ||
smset.emplace("world"); | ||
smset.emplace("is"); | ||
smset.emplace("is"); | ||
thefoo_rw(); // Set break point at this line. | ||
|
||
return 0; | ||
} |
9 changes: 0 additions & 9 deletions
9
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile
This file was deleted.
Oops, something went wrong.
80 changes: 0 additions & 80 deletions
80
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp
This file was deleted.
Oops, something went wrong.