|
3 | 3 | use super::super::codegen::TypeExt;
|
4 | 4 | use crate::codegen_cprover_gotoc::codegen::PropertyClass;
|
5 | 5 | use crate::codegen_cprover_gotoc::GotocCtx;
|
6 |
| -use cbmc::btree_string_map; |
7 | 6 | use cbmc::goto_program::{Expr, ExprValue, Location, Stmt, SymbolTable, Type};
|
| 7 | +use cbmc::{btree_string_map, InternedString}; |
8 | 8 | use rustc_middle::ty::layout::LayoutOf;
|
9 | 9 | use rustc_middle::ty::Ty;
|
10 |
| -use tracing::warn; |
| 10 | +use tracing::debug; |
11 | 11 |
|
12 | 12 | // Should move into rvalue
|
13 | 13 | //make this a member function
|
@@ -46,18 +46,20 @@ impl<'tcx> GotocCtx<'tcx> {
|
46 | 46 | /// This means that if the unimplemented feature is dynamically used by the code being verified, we will see an assertion failure.
|
47 | 47 | /// If it is not used, we the assertion will pass.
|
48 | 48 | /// This allows us to continue to make progress parsing rust code, while remaining sound (thanks to the `assert(false)`)
|
49 |
| - /// |
50 |
| - /// TODO: https://github.com/model-checking/kani/issues/8 assume the required validity constraints for the nondet return |
51 |
| - /// TODO: https://github.com/model-checking/kani/issues/9 Have a parameter that decides whether to `assume(0)` to block further traces or not |
52 | 49 | pub fn codegen_unimplemented(
|
53 | 50 | &mut self,
|
54 | 51 | operation_name: &str,
|
55 | 52 | t: Type,
|
56 | 53 | loc: Location,
|
57 | 54 | url: &str,
|
58 | 55 | ) -> Expr {
|
59 |
| - // TODO: This should print a more user friendly warning format. |
60 |
| - warn!("codegen_unimplemented: {} at {}", operation_name, loc.short_string()); |
| 56 | + // Save this occurrence so we can emit a warning in the compilation report. |
| 57 | + debug!("codegen_unimplemented: {} at {}", operation_name, loc.short_string()); |
| 58 | + let key: InternedString = operation_name.into(); |
| 59 | + if !self.unsupported_constructs.contains_key(&key) { |
| 60 | + self.unsupported_constructs.insert(key, Vec::new()); |
| 61 | + } |
| 62 | + self.unsupported_constructs.get_mut(&key).unwrap().push(loc.clone()); |
61 | 63 |
|
62 | 64 | let body = vec![
|
63 | 65 | // Assert false to alert the user that there is a path that uses an unimplemented feature.
|
|
0 commit comments