Cleanup duplicate static inline functions at/after linking#1987
Cleanup duplicate static inline functions at/after linking#1987tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
dd3d23d to
128d1ae
Compare
5fe23d7 to
914fcee
Compare
914fcee to
833f4cd
Compare
| #ifndef TEST2 | ||
| #include "foo.h" | ||
| #else | ||
| inline void foo(int x) |
There was a problem hiding this comment.
Comment in either the code or the .desc files what you're expecting here. I might be being thick, but I don't follow what you're expecting to differ, except that the non-static inline foo would leave an external-linkage version of the function body around for a potential linked object expecting an extern void foo(int), which doesn't in fact exist in this test?
There was a problem hiding this comment.
I have added explanations in the .desc files.
| static int foo(int a) | ||
| { | ||
| return a+1; | ||
| return a + 2; |
There was a problem hiding this comment.
This makes sure the functions are actually different so that the static variant doesn't get ignored after the changes in this PR.
| continue; | ||
|
|
||
| std::string new_name = id2string(rename_it->second); | ||
| std::string::size_type suffix_pos = new_name.find("$link"); |
There was a problem hiding this comment.
Instead of this grungy string decomposition, how about annotating such symbols with a comment ID_C_original_function_identifier or such?
There was a problem hiding this comment.
That would seem nice, but I'm struggling to find a good place to put it in a symbolt?
There was a problem hiding this comment.
I've been sticking annotations like this on the type myself. We should agree on a policy though, or make a breaking change to add symbolt::attributes
There was a problem hiding this comment.
I do think that the name and the type are really disjoint, so I'd much rather sort this out via some to-be-added symbolt::attributes.
src/linking/linking.cpp
Outdated
| return false; | ||
| return (new_symbol.is_file_local || old_symbol.is_file_local) && | ||
| (new_symbol.type.id() != ID_code || | ||
| new_symbol.value == exprt("compiled") || |
There was a problem hiding this comment.
Factor out this magic tag exprt?
src/goto-programs/goto_program.cpp
Outdated
| } | ||
| } | ||
|
|
||
| bool goto_programt::instructiont::equal(const instructiont &other) const |
There was a problem hiding this comment.
Nitpick: I'd expect equals, or operator==
src/goto-programs/goto_program.cpp
Outdated
|
|
||
| bool goto_programt::instructiont::equal(const instructiont &other) const | ||
| { | ||
| return type == other.type && code == other.code && guard == other.guard && |
There was a problem hiding this comment.
Reading ease: suggest break after each &&
src/goto-programs/goto_program.cpp
Outdated
| return false; | ||
|
|
||
| long jump_difference1 = 0; | ||
| if(!ins.targets.empty()) |
There was a problem hiding this comment.
Should compare other targets I think -- e.g. catch instructions have several targets.
833f4cd to
1bf46ee
Compare
|
@smowton: all comments either addressed or commented on. @peterschrammel If you have any tests exercising |
|
Looks good, except I'd move the target distance comparison inside |
|
@smowton I was about to implement your suggestion but then figured I'd disagree when looking on how this would impact the unified diff implementation: consider |
1bf46ee to
3d199b1
Compare
|
Hmmmm, okay, I won't argue the point further |
3d199b1 to
d968793
Compare
|
@tautschnig, we are retesting this version on our benchmarks. |
|
@tautschnig, the output is identical to |
d16a5b3 to
fd9896f
Compare
allredj
left a comment
There was a problem hiding this comment.
Passed Diffblue compatibility checks (cbmc commit: fd9896f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86271881
fd9896f to
623340a
Compare
allredj
left a comment
There was a problem hiding this comment.
Passed Diffblue compatibility checks (cbmc commit: 623340a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88760998
623340a to
9a0de06
Compare
allredj
left a comment
There was a problem hiding this comment.
✔️
Passed Diffblue compatibility checks (cbmc commit: 9a0de06).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/95548556
9a0de06 to
dcf5904
Compare
allredj
left a comment
There was a problem hiding this comment.
✔️
Passed Diffblue compatibility checks (cbmc commit: dcf5904).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/103507544
3b94bf0 to
15dbc4d
Compare
allredj
left a comment
There was a problem hiding this comment.
✔️
Passed Diffblue compatibility checks (cbmc commit: 15dbc4d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/107061824
15dbc4d to
2244100
Compare
2244100 to
77bc8f1
Compare
Codecov ReportBase: 78.43% // Head: 78.49% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1987 +/- ##
===========================================
+ Coverage 78.43% 78.49% +0.06%
===========================================
Files 1670 1670
Lines 191671 191691 +20
===========================================
+ Hits 150331 150470 +139
+ Misses 41340 41221 -119
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
@tautschnig Any chance of a push to rerun the CI jobs (including the new/missing one)? |
77bc8f1 to
d34b1a9
Compare
d34b1a9 to
5a9e873
Compare
This will avoid some occurrences of function$linkN names that are confusing to users, in particular when specifying loop unwinding limits.
5a9e873 to
1ee95db
Compare
|
Closing due to age (no further comment on PR content), please reopen with rebase on develop if you intent to continue this work. |
No description provided.