This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Add initializer_list constructor to SmallDenseMap
ClosedPublic

Authored by kuhar on Jul 20 2021, 7:27 AM.

Details

Summary

Make it easier to initialize small maps inline. Note that DenseMap already has an initializer_list constructor.

Diff Detail

Event Timeline

kuhar created this revision.Jul 20 2021, 7:27 AM
kuhar requested review of this revision.Jul 20 2021, 7:27 AM
dblaikie accepted this revision.Jul 20 2021, 11:51 AM

Sounds good

llvm/unittests/ADT/DenseMapTest.cpp
551

I'd probably test this with = rather than () style syntax - to demonstrate that it's intentional/verify that implicit construction works

This revision is now accepted and ready to land.Jul 20 2021, 11:51 AM
kuhar updated this revision to Diff 360224.Jul 20 2021, 11:57 AM

Use the assignment syntax in the test, per David's suggestion.

kuhar marked an inline comment as done.Jul 20 2021, 11:57 AM
This revision was landed with ongoing or failed builds.Jul 21 2021, 6:32 AM
This revision was automatically updated to reflect the committed changes.