This is an archive of the discontinued LLVM Phabricator instance.

[formatters] Add a libstdcpp formatter for multimap and unify modify tests across stdlibs
ClosedPublic

Authored by danilashtefan on Oct 28 2021, 1:36 PM.

Details

Summary

This diff adds a data formatter for libstdcpp's multimap. Besides, it improves and unifies the tests for multimap for libcxx and libstdcpp for maintainability.

Diff Detail

Event Timeline

danilashtefan requested review of this revision.Oct 28 2021, 1:36 PM
danilashtefan created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 1:36 PM
danilashtefan retitled this revision from [formatters] Add a libstdcpp formatter for multimap and unify tests across stdlibs to [formatters] Add a libstdcpp formatter for multimap. Unify and modify tests across stdlibs.Oct 28 2021, 1:38 PM
danilashtefan added a reviewer: wallace.
danilashtefan edited the summary of this revision. (Show Details)Oct 28 2021, 1:39 PM
danilashtefan retitled this revision from [formatters] Add a libstdcpp formatter for multimap. Unify and modify tests across stdlibs to [formatters] Add a libstdcpp formatter for multimap and unify modify tests across stdlibs.Oct 29 2021, 2:04 AM
wallace requested changes to this revision.Oct 29 2021, 7:19 PM

pretty good, just cosmetic changes and a comment update needed

lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
915

Now I don't like the name of the class. Let's rename it to MakeLikeSynthProvider, and update the comments mentioning that it supports any map-like structure like map, multimap, set and multiset.

lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
40

nice!!

88–285

the general practice is to leave a space after each comma for readability, e.g.

self.check("ss", 3)

instead of

self.check("ss",3)

these little details matter as it help people more easily distinguish the end of each token

320

same here

This revision now requires changes to proceed.Oct 29 2021, 7:19 PM

All the above specified parts are changed. Thank you!

I thought that you misprinted the name and wanted to call the formatter MapLikeSynth provider. Please, correct me if I am wrong and I will change names accordingly

wallace accepted this revision.Oct 30 2021, 12:50 PM

thanks! i'll land this now

lldb/examples/synthetic/gnu_libstdcpp.py
321

this is correct

This revision is now accepted and ready to land.Oct 30 2021, 12:50 PM