Repository navigation
Add warning for unsupported constructs - #1095
Merged
Merged
Conversation
For now, at the end of each compilation unit, we will print one single warning if we found any unsupported construct. This warning will list the name and number of occurrences of each unsupported constructs that was found.
celinval
commented
Apr 22, 2022
| /// If it is not used, we the assertion will pass. | ||
| /// This allows us to continue to make progress parsing rust code, while remaining sound (thanks to the `assert(false)`) | ||
| /// | ||
| /// TODO: https://github.com/model-checking/kani/issues/8 assume the required validity constraints for the nondet return |
Contributor
Author
There was a problem hiding this comment.
These two issues have been closed already. Removing the TODO.
Contributor
|
LGTM. Thanks! Can we add a sentence at the end of the message to clarify what the impact of this warning is, e.g. |
Contributor
Author
|
Sure |
zhassan-aws
approved these changes
Apr 22, 2022
danielsn
reviewed
Apr 25, 2022
danielsn
left a comment
Contributor
There was a problem hiding this comment.
Not necessarily for this PR, but we should probably also post these warnings in the Cbmc-viewer report
| debug!("codegen_unimplemented: {} at {}", operation_name, loc.short_string()); | ||
| let key: InternedString = operation_name.into(); | ||
| if !self.unsupported_constructs.contains_key(&key) { | ||
| self.unsupported_constructs.insert(key.clone(), Vec::new()); |
Contributor
There was a problem hiding this comment.
I think the clone is not needed, because InternedString is Copy
| .map(|(key, val)| (key.map(|s| String::from(s)), val)) | ||
| .collect(); | ||
| let mut msg = | ||
| String::from("Compilation unit included the following unsupported constructs:\n"); |
Contributor
There was a problem hiding this comment.
Is "Compilation unit" familiar terminology to our users?
Contributor
Author
There was a problem hiding this comment.
I changed the message. Let me know what you think.
Conflicts: kani-compiler/src/codegen_cprover_gotoc/utils/utils.rs
danielsn
approved these changes
Apr 25, 2022
tedinski
pushed a commit
that referenced
this pull request
Apr 27, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
For now, at the end of each compilation unit, we will print one single warning if we found any unsupported construct. This warning will list the name and number of occurrences of each unsupported constructs that was found.
Output example:
Resolved issues:
Resolves #922
Call-outs:
Testing:
How is this change tested?
Is this a refactor change?
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.