-
Notifications
You must be signed in to change notification settings - Fork 283
Goto instrument loop unwinding #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Goto instrument loop unwinding #241
Conversation
5d3eea2 to
7612db8
Compare
|
The Linux builds now also work with a new travis.yml file that provides a more recent version of libstdc++. |
|
May I ask for some reasonable squashing of commits, please? |
7612db8 to
d948765
Compare
|
Ok, done. |
src/util/string_utils.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in other places just strings are thrown (and then also caught) I would suggest to use
throw "split string did not generate exactly 2 parts";
(and drop #include <stdexcept>)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised to see the quotes, see below for a suggestion on how to get rid of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the testfile were required to be the first (instead of the last) argument then the code could be simplified and all the quotes would become unnecessary. More below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't test.pl always pass the testfile as the last argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe test.pl should be tweaked to simplify such scripts? Else there could be a brief options parser in this code to extract the last argument from $@.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use [ -z $# ] if moving the file argument into the first position and add || [ ! -s $1 ] to ensure it's a valid file(name).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To address both the argument swapping and add support for path names containing "." use:
name=$(echo $1 | sed 's/\.[^\.]*$//')
shift
src/goto-instrument/unwind.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k is unsigned, this is trivially true.
src/goto-instrument/unwind.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k is unsigned
src/goto-instrument/unwind.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fresh goto_programt, should be trivially true?!
src/goto-instrument/unwind.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I read the code correctly, this is the else case of k!=0 - should be trivially true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: just one blank line
d7b0f33 to
39dd631
Compare
|
danpoe commented on this pull request.
> @@ -1324,6 +1360,10 @@ void goto_instrument_parse_optionst::help()
"Semantic transformations:\n"
" --nondet-volatile makes reads from volatile variables non-deterministic\n"
" --unwind <n> unwinds the loops <n> times\n"
+ " --unwindset L:B,... unwind loop L with a bound of B\n"
+ " --partial-loops permit paths with partial loops\n"
+ " --unwinding-assertions generate unwinding assertions\n"
+ " --rest-loops add loop for remaining iterations after unwound part\n"
How about "--continuation-loops"? It's not perfect either but at least gives some idea about what it does.
I do like this suggestion if it weren't for "continuation" to have a
well-defined meaning in programming languages already. Maybe
"--continue-as-loops" ?
Best,
Michael
|
dba29d6 to
f13cff5
Compare
|
Ok, I think I've addressed everything. |
tautschnig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some nice-to-have notes.
src/util/string_utils.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to place this in the unit/ top-level folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've added this to the unit tests folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit surprised this works without std::, but it has done before. Maybe use safe_string2int so that we can later put in std::stoi across the codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed this to safe_string2int().
.travis.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intentionally add .travis.yml changes to this pull request? (I am in favour of those changes, just asking.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using some new versions of methods of, e.g., std::set that were added in C++11. This didn't compile with the old travis file as the STL version it used for the Linux builds was too old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for clarifying!
f13cff5 to
c8c7c29
Compare
|
Unless anyone else voices concerns, it should just be a rebase that's blocking a merge. |
src/util/string_utils.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should that be ssize_t?
src/util/string_utils.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or use some reverse iterator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used a reverse iterator for this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unfortunately needs to include widen() on WIN32, or Unicode filenames won't work.
c8c7c29 to
1157ad3
Compare
|
This is now rebased and I've addressed the additional comments. |
Fix issue #241 - Conversion from int
SEC-41 : Integration of the 'full-slicer' into the pipe-line (tools-chain).
…s-with-sharing-merge Fix reaching definitions with sharing merge
Loop unwinding with: