This is an archive of the discontinued LLVM Phabricator instance.

[esan] Add iterator to esan's generic hashtable
ClosedPublic

Authored by bruening on Jul 22 2016, 8:20 AM.

Diff Detail

Event Timeline

bruening updated this revision to Diff 65081.Jul 22 2016, 8:20 AM
bruening retitled this revision from to [esan] Add iterator to esan's generic hashtable.
bruening updated this object.
bruening added a reviewer: aizatsky.
bruening added subscribers: llvm-commits, eugenis, kcc and 2 others.
bruening removed a subscriber: zhaoqin.
aizatsky added inline comments.Jul 27 2016, 2:18 PM
lib/esan/esan_hashtable.h
70

Specify that iterator copies data, so it would be inefficient for non-primitive types.

343

I'm not sure that this iterator is correct when table is empty. Could you add a test please?

test/esan/Unit/hashtable.cpp
86

Please also add a small test to make sure it works with

for (auto Pair : DataTable) {
}

aizatsky requested changes to this revision.Jul 27 2016, 2:18 PM
aizatsky edited edge metadata.
This revision now requires changes to proceed.Jul 27 2016, 2:18 PM
bruening marked 3 inline comments as done.Aug 1 2016, 1:10 PM
bruening added inline comments.
lib/esan/esan_hashtable.h
343

I believe it should work...and it works in my added test.

bruening updated this revision to Diff 66365.Aug 1 2016, 1:10 PM
bruening edited edge metadata.
bruening marked an inline comment as done.

Address reviewer requests: more tests, comment on copying.

aizatsky accepted this revision.Aug 1 2016, 1:18 PM
aizatsky edited edge metadata.
This revision is now accepted and ready to land.Aug 1 2016, 1:18 PM
This revision was automatically updated to reflect the committed changes.