Skip to content

Conversation

@thk123
Copy link
Contributor

@thk123 thk123 commented Jun 5, 2020

Rebased version of #5205, with two additions:

  • tests for the const iterators added to base symbol table

  • stop definitions in symbol_table hiding the implemention in symbol_table_baset (risks these defintions going out of sync)

  • Each commit message has a non-empty body, explaining why the change was made.

  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.

  • [na] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/

  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).

  • [na] My commit message includes data points confirming performance improvements (if claimed).

  • My PR is restricted to a single feature or bugfix.

  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

This don't show up on travis because the unit tests are currently
not being built on Travis if USE_STD_STRING is set.  Originally by
Hannes Steffenhagen.
@codecov
Copy link

codecov bot commented Jun 5, 2020

Codecov Report

Merging #5375 into develop will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5375   +/-   ##
========================================
  Coverage    68.15%   68.15%           
========================================
  Files         1173     1173           
  Lines        97392    97392           
========================================
  Hits         66380    66380           
  Misses       31012    31012           
Flag Coverage Δ
#cproversmt2 42.47% <0.00%> (ø)
#regression 65.36% <100.00%> (ø)
#unit 32.19% <100.00%> (+<0.01%) ⬆️
Impacted Files Coverage Δ
src/util/journalling_symbol_table.h 78.94% <ø> (ø)
src/util/symbol_table.h 100.00% <ø> (ø)
src/util/symbol_table_base.h 88.46% <ø> (ø)
src/util/symbol_table_builder.h 65.21% <ø> (ø)
src/util/symbol_table_base.cpp 70.83% <100.00%> (+5.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 830c302...6196338. Read the comment docs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the USE_STD_STRING change I don’t believe any of these changes should be merged as they already exist in some form or another on develop.

#endif

#ifndef USE_STRING
#ifndef USE_STD_STRING

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: I’d really love if we could just get rid of USE_STD_STRING already. I’m not entirely convinced we keep it around for anything other than nostalgia at this point.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the only use case for it is / was debugging problems in the dtringt implementation. I am not sure how many issues it will find that have not already been found.


symbol_table_baset::const_iteratort symbol_table_baset::end() const
{
return symbols.end();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

96bd3ae s/interate/iterate in the commit message.

Also this commit should be removed; Current develop already has begin/end for symbol_tablet.


int counter = 0;
for(auto &entry : symbol_table)
SECTION("Non const iterator")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit (a9afb9a) can also be removed; symbol table iterators are tested in unit/util/symbol_table.cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see a single class to begin() but no call to end. This also tests the correct dispatching when you have a symbol_tablet but the compile time type is symbol_table_baset

return internal_symbols.end();
}
using symbol_table_baset::begin;
using symbol_table_baset::end;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop symbol_table_baset::begin/end are both purely virtual, so can not be used in this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed out of band: more consistent to have both const and non-const iterators be virtual and defined in the base class.

martin and others added 2 commits June 12, 2020 13:52
Patch originally by Chris Ryder.
Check that both const and non-const iterators work as expected.
@thk123
Copy link
Contributor Author

thk123 commented Jun 12, 2020

@hannes-steffenhagen-diffblue I've made the begin/end virtual in the base class as agreed, ready for re-review

@thk123 thk123 marked this pull request as ready for review June 12, 2020 12:53
Since the const iterators can use the base class directly, these are not
pure virtual - so derived classes can still provide an entirely
different mechanism for iterating over the symbols - though this is not
currently used.
Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am happy once @hannes-steffenhagen-diffblue 's comments have been addressed. I think that it will still work with the patch set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think it’s a bit inconsistent we have a pure virtual mut begin/end but an implementation for const begin/end. But I’d not block on that if that’s the only complaint.

@thk123
Copy link
Contributor Author

thk123 commented Jun 18, 2020

@peterschrammel if you get a min, would you be able to provide the code owner review for this short PR? You reviewed this originally in #5205, Martin addressed your comments (this is a rebased version)

@thk123 thk123 merged commit df2638c into diffblue:develop Jun 19, 2020
@thk123 thk123 deleted the vsd/util branch June 19, 2020 17:49
@thk123 thk123 mentioned this pull request Jun 19, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants